Questions tagged [omnithreadlibrary]

OmniThreadLibrary is a Delphi library meant to ease threading.

It's written mainly by Primož Gabrijelčič and released under BSD license.

Resources:

124 questions
20
votes
2 answers

OmniThreadLibrary Overview

Is there a place where there is an introductory overview of the OmniThreadLibray for Delphi? I have the current code installed in Delphi XE. The examples work. I've been looking over the associated The Delphi Geek blog with usage examples. Gabr…
Rich Shealer
  • 3,362
  • 1
  • 34
  • 59
13
votes
5 answers

How to implement thread which periodically checks something using minimal resources?

I would like to have a thread running in background which will check connection to some server with given time interval. For example for every 5 seconds. I don't know if there is a good "desing pattern" for this? If I remember corretly, I've read…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
12
votes
4 answers

Delphi - Threading frameworks

I am looking for a Threading framework to use in my Delphi application. Currently I am evaluating ‘OmniThreadLibrary’ - so far it looks good and does everything I need. Is there any other ‘Threading framework’ for Delphi ? (I am using D2006 &…
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
12
votes
1 answer

Porting a multi-threading Delphi application to Mac: what are my choices?

I need to port an application (written in XE2) to Mac. My application is split into a simple UI executable (single-threaded) and an invisible engine (which heavily relies on OmniThreadLibrary 3.02 and Cromis DirectoryWatch) Both EXEs communicate via…
TheDude
  • 3,045
  • 4
  • 46
  • 95
10
votes
1 answer

Why do I need Sharemem in my Delphi dll which only exposes a function with WideString parameters?

I have a dll and a test application written in Delphi. The test application uses multiple threads to call the function exported by the dll. The exported function has a trivial thread safe implementation. When running the test application various…
RM.
  • 1,984
  • 19
  • 29
10
votes
2 answers

Why does the following code using IOmniThreadPool cause access violations?

In our Delphi XE4 application we are using an OmniThreadPool with MaxExecuting=4 to improve the efficiency of a certain calculation. Unfortunately we are having trouble with intermittent access violations (see for example the following MadExcept bug…
Tim
  • 375
  • 1
  • 4
  • 18
7
votes
0 answers

OmniThread alternatives for iOS/Android/OSX?

Are there any alternatives to OmniThread under iOS/Android/OSX? It does not need to be as complete as OmniThread, I just need to be able to have thread pools and TFuture<> classes. Thanks! UPDATE: Delphi XE7 now implements Future/Parallel/Task in…
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
6
votes
2 answers

How can I capture variables by anonymous method when using it in OTL?

What I want to do: I have a few objects in a genric list. I want to capture each of this object in anonymous method and execute this method as a separate OTL Task. This is a simplified example: program Project51; {$APPTYPE CONSOLE} uses …
Wodzu
  • 6,932
  • 10
  • 65
  • 105
5
votes
2 answers

How upload files to azure in background with Delphi and OmniThread?

I have tried to upload +100 files to azure with Delphi. However, the calls block the main thread, so I want to do this with a async call or with a background thread. This is what I do now (like explained here): procedure…
mamcx
  • 15,916
  • 26
  • 101
  • 189
5
votes
0 answers

Using DataSet returned by a datasnap ServerMethod in a thread?

I am calling a servermethod from within a thread using Omnithreadlibrary, the data is returned succesfully, but I have troubles using the data returned, everything i've tried goes with AccessViolation or even crash of the application, tryed also to…
g13013
  • 51
  • 2
5
votes
4 answers

Multithreaded WinHttp downloads

I am creating a Delphi application to download files from the Internet and if the server supports range requesting it will be multi threaded. The progress is also relayed back to the GUI. The current software model uses TThread components. The GUI…
Hzmy
  • 769
  • 7
  • 16
5
votes
1 answer

How to update progress indicator from a second thread?

I have a main form with a progress indicator on it. In the datamodule I've ten datasets, each of them has an OnBeforeOpen event defined. I would like to show through the progress bar in the main form a percentage of progress of the opened…
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38
5
votes
0 answers

How to replace TThread with OmniThreadLibrary?

I am used to create TThread descendants to do longlasting DB operations. My usual construct looks like this: interface type TMyDBOp = class(TThread) private FConnection: TADOConnection; FCommand1: TADOCommand; FCommand2: TADOCommand;…
Tom Hagen
  • 277
  • 2
  • 10
5
votes
1 answer

Does OmnithreadLibrary support "work stealing"?

Work stealing is for example available in the Fork / Join framework on the Java platform. (See How is the fork/join framework better than a thread pool?) - is something similar possible with the OmniThreadLibrary? Work stealing: worker threads…
mjn
  • 36,362
  • 28
  • 176
  • 378
4
votes
1 answer

Execution point for other threads in Delphi 2010

I'm developing a multithreaded client app using Delphi 2010 (using the excellent OmniThreadLibrary) and I'm having hard time with debugging since I'm constantly swapping from one thread to another. I wonder if it's possible (using whatever tool or…
TheDude
  • 3,045
  • 4
  • 46
  • 95
1
2 3
8 9