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
1
vote
0 answers

Is it safe to use local variable in OTL Async/Await Thread?

I am sorry for asking such a simple question. This is the first time I am using a background thread in VCL. So I was wondering if it is safe to use local variable in Async part? procedure Tfrm1.ThreadedFillDataset; var ds : TOracleDataSet; begin …
akaya
  • 110
  • 4
  • 9
1
vote
1 answer

Why does my application using OmniThreadLibrary Parallel.Pipeline continue remain running in the background after being closed?

I'm using OmniThreadLibrary to implement a background pipleline for sending emails (refer to this SO question). I notice that after closing the application, it continues running in the background (seen in Windows Task Manager). That means that there…
Steve F
  • 1,527
  • 1
  • 29
  • 55
1
vote
0 answers

Delphi TParallel not using all available cpu

We are migrating our multi-threaded application to Delphi XE7 and are testing the new TParallel.For function. We have found that it parallelizes well on laptops (Core I-5/Windows 7 with 4 cores) achieving close to consistent 100% cpu usage. When we…
Alan Clark
  • 2,017
  • 21
  • 28
1
vote
2 answers

How to know the state of Pipeline stages in OmniThreadLibrary?

gabr's answer to another question shows an example of using Parallel.Pipeline for data processing. At the moment I need to know when the Pipeline was started and when all its stages are completed. I read the other gabr's answer for this problem How…
LuFang
  • 191
  • 3
  • 12
1
vote
1 answer

How do I design a "conveyor" of operations with OmniThreadLibrary?

I have a Windows Delphi application with "Start" and "Stop" menu items accessible via a notification icon. After click on "Start", I need to do the following (as I see implementation): ThreadMonitor: The first thread is waiting for the appearance…
LuFang
  • 191
  • 3
  • 12
1
vote
1 answer

Delphi - OmniThreadLibrary Parallel.ForEach with Records

I am running Delphi XE2 and trying to get familiar with the OmniThreadLibrary, I have 3.03b installed. I have been looking at the Parallel.ForEach examples and am not sure of what's going on in the background (this may well be obvious later -…
Trojanian
  • 692
  • 2
  • 9
  • 25
1
vote
1 answer

Delphi OTL Why does MultiThreading program uses only half the available CPU's

During executing my multithreading program only 4 of the available 8 CPU's are being used. Why? What can I change to make all CPU's working? Parallel.ForEach(0, CalcList.Count-1) .NumTasks(nMax) .NoWait .Execute( procedure(const value:…
Frits Molenkamp
  • 175
  • 1
  • 10
1
vote
1 answer

Accessing parameter in OmniThread parallel task aborts the task

In a program which uses the OmniThread library to create a parallel task, when I try to access a parameter in the parallel task, the code following after the parameter access is not executed, so obviously the task is aborted: uses System.SysUtils,…
user1580348
  • 5,721
  • 4
  • 43
  • 105
1
vote
1 answer

Why am I getting this error with OTL?

I am using OTL for the first time and I was trying to use the Async/Await abstraction. Now, I created a small program just to see what will happen. It's just a button and it calls this procedure. procedure TForm2.Button1Click(Sender: TObject); var…
Diego Rueda
  • 2,226
  • 4
  • 21
  • 41
1
vote
3 answers

Reading flat file with delphi OmniThreadLibrary

I am reading very wide file with delphi The file is comma delimited, most of the time is spend parsing strings. The logic is follows open file read line split line into array of records Pass spitted array to the next procedure go to step 2 close…
1
vote
0 answers

OTL - Kill Task on Demand

How can I kill task on Demand? When i do this: CreateTask(TWorker.Create()) .Invoke(@TWorker.Execute) .MonitorWith(FEventMonitor) .SetParameter('ThreadID',i) …
user1647411
1
vote
1 answer

Is it possible to reset/reinitialize a pipeline (or BackgroundWorker) in OmniThreadLibrary?

By re-initialize, I mean stop the running tasks (or even kill the threads if I have to) & revert back as if the pipeline/threads were never initialized / started. My code (I'm using delphi 2010, OmniThreadLibrary 3.02) looks like this: procedure…
TheDude
  • 3,045
  • 4
  • 46
  • 95
1
vote
1 answer

How to pause/resume threads in OmniThreadLibrary 3?

I want the main application thread to be able to pause / resume the other working threads, assuming this is possible, what's the best way to do this? Any suggestion that would work on Windows XP (and later) would be more than welcome! PS. I'm using…
TheDude
  • 3,045
  • 4
  • 46
  • 95
0
votes
0 answers

How to use SSH connection from inside thread using omnithread library?

I use Devart TScSSHClient component to start a SSH connection to a device, after connecting I use SSHterminal to send a command and retrieve the result. My question How can I end the thread manually (omnithread that I started) after receiving the…
David
  • 1
  • 1
0
votes
0 answers

Omnithread unobserved nested thread not released when expected

Background My Flagship App seems to leak memory. Well, not really but just during runtime. Investigating this showed the memory 'leak' is resolved when the app closes, but not in between. I am using a background thread , that iself starts another…
H.Hasenack
  • 1,094
  • 8
  • 27
1 2 3
8 9