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
2 answers

Is this a correct way of using OmniThreadLibrary - terminate the existing one then create a new one?

I use the excellent OmniThreadLibrary library to implement threaded source code parsing, the program need to abandon the existing parsing and restart the parsing whenever the source code is changed. I do this with the code snippet shown below, is…
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
1
vote
1 answer

IOmniTaskControl.Unobserved - the task is never destroyed

I am trying to run a fire-and-forget task - IOmniTaskControl.Unobserved works well enough with either IOmniTaskControl.Run or IOmniTaskControl.Schedule(IOmniThreadPool), but the IOmniTaskControl object is never destroyed. I am limited to using…
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
1
vote
1 answer

CoInitialize/CoUninitialize error handling in OTL TOmniBlockingCollection (COM multi-threading)

I am using TOmniBlockingCollection from a "Server Thread". In this thread, I am hosting a Single-Threaded Apartment COM object to a DataProvider (CoInitialize() and CoUninitialize() are called). Then additionally, I am using multiple worker threads…
1
vote
1 answer

IOmniPipeline - 2nd stage is not getting executed

I have a simple implementation of pipeline (IOmniPipeline) but the 2nd stage that is added is not being executed. Code follows: var OmniPipeline: IOmniPipeline; begin OmniPipeline := Parallel.Pipeline; OmniPipeline.Stage(DoDataTransfer_A);…
Steve F
  • 1,527
  • 1
  • 29
  • 55
1
vote
1 answer

Delphi: SQL Query in Omni Parallel.foreach blocking main thread

I have a parallel.foreach loop which is blocking the interface from responding. In the loop I am calling a function which calls a mySQL stored procedure. I would like this to happen in the background but it restricts the UI from responding until all…
1
vote
1 answer

"Emergency" termination of omnithread IOmniParallelTask

Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( …
H.Hasenack
  • 1,094
  • 8
  • 27
1
vote
1 answer

parallel.async, pass parameters thread-safe

Take a look at this (pseudo) code procedure TestASync; begin var lSomeIntf:=TSomeImplementor.Create as ISomeIntf; parallel.ASync( procedure begin sleep(1000); // allow the main thread to finish MyThreadedProc(lSomeIntf); …
H.Hasenack
  • 1,094
  • 8
  • 27
1
vote
1 answer

Delphi OmniThreadLibrary and Async

Hopefully a simple one. I am using an OTL Parallel.For loop to process lots of data. The amount of data can change and if there is a lot (that takes over 2 seconds) Windows flickers the application form and gives a temporary "not responding"…
Some1Else
  • 715
  • 11
  • 26
1
vote
1 answer

What abstraction to use for an ASynchronous data collection driver

I would like to implement a mechanism in my server application but I'm not sure which OTL abstraction would be best appropriate. My application collects data about various types of equipements. Some of them use synchronous communication, thus…
mathieu
  • 235
  • 2
  • 11
1
vote
1 answer

How to set a higher task priority to a Parallel.Async background task?

I need to assign a higher task priority to a Parallel.Async background task. Since the OmniThreadLibrary has SetPriority: How can I set a specific priority to this Parallel.Async task? uses CodeSiteLogging, OtlParallel, OtlTaskControl,…
user1580348
  • 5,721
  • 4
  • 43
  • 105
1
vote
1 answer

How to Stop all Pipeline tasks correctly

how to stop Pipleline tasks correctly, I've tried but when i press Abort button i get an AV, i'm not too good at debugging,i have reached to DoOnStop(task); in OtlParallel then i couldn't figure out what to do next, i believe there is something…
Thunderx
  • 169
  • 1
  • 9
1
vote
1 answer

How to use Rcords to pass parameters to the queue

how i can pass memo lines strings to TRecords fields to use theme as a parameters for idHTTP POST methode? usually id do it like this for i := 0 to Memo1.Lines.Count-1 do begin P := Pos('+', Memo1.Lines.Strings[i]); Email:=…
Thunderx
  • 169
  • 1
  • 9
1
vote
1 answer

How can I check exceptions when using IOmniTaskControl/TOmniWorker?

I'm using an IOmniTaskControl/TOmniWorker to funnel code execution onto a specific thread. I'll reuse this IOmniTaskControl repeatedly for multiple Invoke calls. How do I check for exceptions that may have occurred during the Invoke? This is a…
Larry Fuqua
  • 148
  • 1
  • 5
1
vote
1 answer

OTL can't be compiled under D2007

I downloaded the OTL http://www.omnithreadlibrary.com/ and compile the D2007 grouproj, install the package, without problem. I then create a simple console application that uses OtlParallel unit, of course, I add the OtlParallel and some other pas…
justyy
  • 5,831
  • 4
  • 40
  • 73
1
vote
1 answer

How to pass an array as parameter to a task with SetParameter from OmniThreadLibrary?

In Delphi XE8, I am trying to pass an array to the OTL task in SetParameter from OmniThreadLibrary: implementation type TCookie = record Name: string; Value: string; ExpDate: string; ModDate: string; end; TCookieArray =…
user1580348
  • 5,721
  • 4
  • 43
  • 105
1 2 3
8 9