Wednesday, October 03, 2012

OmniThreadLibrary 3.02 released

OmniThreadLibrary 3.02 was released today. This is mostly a bugfix release with few new parts (XE3 support, Async/Await). Update is strongly recommended for everybody.
Get it as a zip or from the svn.

Changes since release 3.01:

New features

  • Compiles with XE3
  • Added XE3 packages and test projects.
  • Added Async/Await abstraction.
  • Added OnStop overload to Parallel.ForEach that accepts 'reference to procedure (const task: IOmniTask)'.
  • Added OnStop overload to Parallel.Pipeline that accepts 'reference to procedure (const task: IOmniTask)'.
  • Implemented TOmniValue.IsRecord.
  • IOmniBackgroundWorker extended with task initializer (Initialize) and task finalizer (Finalize).
  • IOmniWorkItem extended with property TaskState.
  • Inlined bunch of TOmniWorkItem methods.

Bug fixes

  • Parallel.Join was broken if number of task to be executed was larger than number of threads. Thanks to [Passella] for reporting the problem.
  • Invalid 'joinState' was passed to the worker task in Parallel.Join if number of tasks to be executed was larger than the number of worker threads. Thanks to [meishier] for reporting the problem.
  • Fixed race condition in task teardown. Big thanks to [meishier] for putting together a reproducible test case.
  • ForEach finalizer is called if an exception occurs inside the ForEach task.
  • OtlParallel added to packages. Thanks to [Mason Wheeler] for reporting the problem.
  • OtlDataManager added to packages.
  • Fixed bug in TOmniTaskGroup.TerminateAll - maxWait_ms parameter was ignored. Thanks to [morlic] for reporting the problem.
  • Workaround for an internal error in D2009. Thanks to [ToHugie] for reporting the problem and to [Hallvard Vassbotn] for providing a fix.
  • Fixed various scenarios where Invoke was not working. Thanks to [geskill] for providing report, test case and incremental testing on my partial solutions.
  • XE2 and XE3 design packages were referring to wrong runtime package (XE).
  • TOmniEventMonitor is marked as 64-bit compliant in XE2+. Thanks to [M.J. Brandt] for reporting a problem.

Other changes

  • Marked IOmniParallelLoop.OnMessage as deprecated (use TaskConfig.OnMessage).

New demos

  • 53_AsyncAwait: Demonstration of the new Async/Await abstraction.

New examples

  • ForEach output: Demonstrates how to 'flow' ForEach output directly into the main thread which immediately processes the data.
  • Twofish: Parallel implementation of the FishFacts demo.


  1. Any chance of adding an example of exception catching in the Async/Await example.

    Its absolutely awesome, as a C#/Delphi coder, having this sugar make my life so much easier.

    Thanks for an amazing library.


    1. I can't think of a good syntax for exception catching.

      What about:

      Async(procedure begin end)
      procedure (E: Exception)
      if assigned(E) then


  2. Anonymous16:37

    Amazing. "Must have" components for serious multithreading development.