OmniThreadLibrary 1.05 was a great success …
… but all good things must come to an end. Don’t worry, I’m not ending the project. It’s just that there’s a new player in town. Ladies and gentlemen, in the left corner I give you …
… OmniThreadLibrary 2.0! Get it while its hot!
The big change is improved high-level parallelism support (sorry, D2007 folks, this works only in D2009 and up). Now you can enjoy using parallel for loops, futures and pipelines (click on the links for more info).
Other improvements are smaller but numerous. Read the whole list below.
Enjoy the new OmniThreadLibrary and remember – I love reading.
What’s new in version two
- New high-level primitives (unit OtlParallel):
- Improved parallel for (Parallel.ForEach).
- Futures (Parallel.Future<T>).
- Pipelines (Parallel.Pipeline).
- Added support for multiple simultaneous timers. SetTimer takes additional 'timerID' parameter. The old SetTimer assumes timerID = 0.
- ParamByName has been removed, use .Param[name: string].
- Param returns TOmniValueContainter.
- IOmniTaskControl.OnMessage also accepts an object (message dispatcher; form, for example).
- IndexOfName renamed to TOmniValueContainer.IndexOf.
- New methods in TOmniValueContainer class: ByName, Count, Exists. New properties:
- Fixed memory leak when sending String, WideString, Variant and Extended values over the communication channel and when queueing them into TOmni[Base]Queue.
- Implemented _AddRef, _Release, _ReleaseAndClear.
- TOmniValue can be cast as Int64.
- Implemented conversions to/from TValue (Delphi 2010 and newer).
- Implemented constructor.
- [scarre] Added TDateTime support.
- New classes and interfaces
- TOmniCounter, auto-initialized wrapper around the IOmniCounter
- TOmniMessageID record, used internally to implement timers
- OmniThreadPool: ThreadDataFactory can now accept either a function or a method.
- TOmniEventMonitor: Message retrieving loop destroys interface immediately, not when the next message is received.
- TOmniTaskFunction renamed to TOmniTaskDelegate.
- Added function CreateResourceCount(initialCount): IOmniResourceCount.
- Renamed IOmniCancellationToken.IsSignaled -> IsSignalled.
- .dproj tests renamed to .2007.dproj.
- Added Delphi XE project files.
- Bugs fixed
- Thread pool was immediately closing unused threads if MaxExecuting was set to -1.
- Ugly bugs in TOmniBlockingCollection removed.
- New demos
- 38_OrderedFor: Ordered parallel for loops.
- 39_Future: Futures.
- 40_Mandelbrot: Parallel graphics demo (very simple).
- 41_Pipeline: Pipelines.
- 42_MessageQueue: Stress tests for TOmniMessageQueue.