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
0
votes
1 answer

Cancel a scheduled task

I have a Windows Delphi application that receives events, on each of these events i'd like to run a task in a parallel way (so i can be ready for the following event). There is many way to do this through omnithread library's abstractions. The issue…
mathieu
  • 235
  • 2
  • 11
0
votes
0 answers

How to block all incoming message to a form while thread is executing

i have the current scenario, im using omnithreadlibrary for some generic background work like this: TMethod = procedure of object; TThreadExecuter = class; IPresentationAnimation = interface ['{57DB6925-5A8B-4B2B-9CDD-0D45AA645592}'] procedure…
kabstergo
  • 761
  • 4
  • 16
0
votes
0 answers

TOmniTaskControl: .Run vs. .Schedule on WinXP

I noticed something while testing some of my code on a Windows XP 32-bit virtual machine: My application always kept hanging. I never had such phenomenon on my Windows 7 64-bit computer but it was 100% reproducible on the VM. Via remote debugging i…
René Hoffmann
  • 2,766
  • 2
  • 20
  • 43
0
votes
1 answer

Delphi OTL Multithreading UI freezes

The UI freezes during execution of my OTL multithreaded program. Tested with one to 16 thread, UI freezes immediately after procedure start. Parallel.ForEach(0, CalcList.Count-1) .NumTasks(nMax) .NoWait .Execute( procedure(const value:…
Frits Molenkamp
  • 175
  • 1
  • 10
0
votes
1 answer

How to handle IOmniParallelJoin finalization in OmniThreadLibrary?

I'm using IOmniParallelJoin to compute the several tasks in parallel with NoWait function because I want the GUI to stay responsive. But I also need to know when the computation is finished. Is there any event which is triggered in such case?
Yuriy Chachora
  • 739
  • 6
  • 18
0
votes
1 answer

OmniThread: How to pass a TRect in SetParameter?

In a program using the OmniThread library, how can I pass a TRect in SetParameter? Example: procedure TestParameters(const ATask: IOmniTask); begin // how can I access the TRect here? end; FTestTask := CreateTask(TestParameters,…
user1580348
  • 5,721
  • 4
  • 43
  • 105
0
votes
1 answer

Terminate and nil OmniThread task when form closes?

This is a sample code for a stopwatch I have implemented as a separate thread with the OmniThread library. This is my question: Do I have to terminate and nil the task when the form closes or will it be destroyed automatically when the form…
user1580348
  • 5,721
  • 4
  • 43
  • 105
0
votes
0 answers

Unobserved TOmniTask... Task controller needs an owner?

I have written a program in Delphi 2007 using the OmniThreadLibrary. I found that the program was growing bigger and bigger in memory as it ran using the following structure to launch tasks. class procedure saveIniFile(const iniFile: TStringList); …
Gavin
  • 2,123
  • 1
  • 15
  • 19
0
votes
1 answer

Is there a way to get the size of TOmniBlockingCollection of OmniThreadLibrary?

Is there a way to get the size (ie. the number of elements) of TOmniBlockingCollection of OmniThreadLibrary? I checked the code, my initial conclusion is no, but I'm not sure.
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
0
votes
2 answers

What is the correct way to free embed object in TOmniMessage?

I have tasks which are sending various messages with data. For example: task.Comm.Send(MSG_JOB_ERROR,[string, string,string,string,string, TObject]) ; On the receiving side I have procedure TUDPBroadCast.OnWorkerJobError(var msg:…
0
votes
0 answers

Correct OmniThread abstraction for a a multi-stage process

I have a sort of complex multi stage process that needs to do the following stages in the background (I am using OmniThreadLibrary) for a document, first in the main thread I create the object (interfaced object) in which I need to perform several…
Luis Carrasco
  • 467
  • 3
  • 10
0
votes
1 answer

Correct Way to Use OmniThreadLibrary Future

I am currently experimenting with OmniThreadLibrary. Enclosed is my code: procedure TMainForm.LongWait; begin Task := Parallel.Future( function: string begin Sleep(10000); Result := 'Done'; end, …
Victor Ian
  • 1,034
  • 13
  • 26
0
votes
0 answers

How best to convert multiple Delphi TTimer background scan tasks using Omnithread

I've started to look at using Omnithread to improve my Delphi Application using multithreading. Creating one or more worker tasks are well covered by the documentation so that long actions that I invoke from button clicks can be replaced by this…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
-1
votes
3 answers

Which is better for this project, procedural or object oriented?

I've been working through many trial/error versions of an image loading/caching system. Being Delphi, I've always been comfortable with Object Oriented Programming. But since I've started implementing some multi-threading, I've been thinking that…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
-1
votes
1 answer

OmniThreadLibrary: How to run Parallel.For.Execute without using anonymous procedure?

The Execute method of Parallel.For has a TOmniIteratorDelegate parameter. But I'm unsure on how to assign a procedure to a variable of that type. The reason for doing this is that I do not want to use anonymous procedures. Is this possible? If yes,…
Steve F
  • 1,527
  • 1
  • 29
  • 55
1 2 3
8
9