Monday, April 22, 2013

Programación Paralela con OmniThreadLibrary


After a long wait, Programación Paralela con OmniThreadLibrary has been synchronized with the english version of the book. The book has now 209 pages and is considered to be 60% complete.

Tuesday, April 16, 2013

OmniThreadLibrary Webinars

In association with De Novo Software ( I am preparing a series of webinars about the multithreading and OmniThreadLibrary. Currently proposed topics are:

1. High-level multithreaded programming with the OmniThreadLibrary

This two part webinar will focus on high-level abstractions (Await, Future, ParallelTask, ForEach, Pipeline etc). In addition to the in-depth presentation of all eight high-level abstractions, the webinar will explore the blocking collection, a queue class extensively used in many high-level abstractions.

2. Low-level multithreaded programming with the OmniThreadLibrary

This webinar will focus on differences between the TThread (Delphi) and CreateTask (OmniThreadLibrary) model and will be intended for programmers that have no problems writing TThread-based code. If will firstly show what the OTL equivalents for the TThread operations are and then continue by exploring the parts of the OTL that have no TThread equivalent (such as writing background tasks without the main thread loop, communicating between the main thread and the task and so on.)

3. Using OmniThreadLibrary frameworks effectively

This webinar will focus on "backend" classes in the OTL - queues, locking primitives, TOmniValue record etc. All of these can be use in any application, single-threaded or multithreaded, TThread- or OTL-based to simplify programming and improve your productivity.

4. “Do's” and “Dont's” of multithreaded programming

This webinar will present best practices for the multithreaded programming. In addition to the abstract talk, it will contain numerous code examples to prove the point.

All of the webinars will be split into 45 minute presentation followed by the 15 minute Q&A part.


To help me determine the best time for webinars and to assess the interest, I have put together a small survey. If you are interested in participating in a webinar or downloading it for your personal use, please fill out the survey. There are only seven questions, none of them mandatory.

All participants of the survey that will leave an email address will be entered into a draw to win a prize – a free copy of the OmniThreadLibrary book!

Thursday, April 11, 2013

ThreadSafe Lock Manager: [3] Test

After you have designed and written some code, you should always test it. This is especially important for the multithreaded code which rarely works on the first (or the second, or third) try.

Friday, April 05, 2013

ThreadSafe Lock Manager: [2] Code

After explaining the design, I’ll continue my trip into the depths of the lock manager by exploring the actual code. Let’s take a look at the public parts first.

[This code is implemented in the OtlSync unit, which is part of the OmniThreadLibrary distribution. You’ll have to fetch the OTL from the SVN to use it.]

Tuesday, April 02, 2013

ThreadSafe Lock Manager: [1] Design

Few weeks ago I ran into a problem. I needed a thread-synchronizing code that would work similarly to a critical section, but would allow me to lock “anything”. If I could limit myself to objects, I could live with TMonitor.Enter/Exit, but I specifically wanted to limit access to some string keys. [In a way, my problem was similar to a problem of locking access to specific items in a string-keyed dictionary. Details differed, though.]

I was thinking about the problem and it turned out not to be a simple one. Yes, I could solve it by introducing a string-keyed dictionary of critical sections but that would be a little bit too limiting for my taste. I had some other requirements in mind which further complicated the implementation.

TL;DR – This lock manager is implemented in the OmniThreadLibrary as IOmniLockManager<K>/TOmniLockManager<K> in the OtlSync unit since revision 1268.