If you haven’t noticed already – OmniThreadLibrary 1.02 has been released few days ago.
The main new feature is reimplemented thread pool. Previous implementation was never meant to be a permanent solution anyway. New thread pool uses OTL as an internal implementation mechanism. Talk about recursion! :) A longer article on the new implementation will follow.
There’s a new Enforced decorator which you can apply to the IOmniTask or IOmniTaskControl. In short – OTL always tries to execute your task. If you call taskControl.Terminate before the task has even started, OTL will set the termination signal and start executing task. This is not a good idea if the task was waiting in the thread pool queue and threadPool.CancelAll or threadPool.Terminate was executed. To bypass this auto-execute behaviour, you can call .Enforced(false).
I’ve implement a critical section which you only have do declare and start using. No need for .Create or .Initialize or similar. An article will follow …
There’s a new demo that shows how to use OTL for background file scanning.
Few small and not so small bugs were fixed and 3rd party units were sync’d to fresh releases.
As usual, you can get it via SVN or as a ZIP archive.
Other important OTL links:
Nice work! Been using OTL with Delphi 2009 and this makes it easy to manage multiple threads. Just upgraded to 1.02 and haven't noticed any regressions. Thanks!!!
ReplyDeleteIs it possible to use OTL to create Connection Pool systems? It seems like OTL solves a lot of the concurrency and communications issues. Is this feasible?
ReplyDelete