Not yet beta as I still have to fix few TODOs …
- Changed semantics in comm event notifications! When you get the 'new message' event, read all messages from the queue in a loop!
- Message is passed to the TOmniEventMonitor.OnTaskMessage handler. There's no need to read from Comm queue in the handler.
- Exceptions in tasks are now visible by default. To hide them, use IOmniTaskControl.SilentExceptions. Test 13_Exceptions was improved to demonstrate this behaviour.
- Works with Delphi 2010.
- Default communication queue size reduced to 1000 messages.
- Support for 'wait and send' in IOmniCommunicationEndpoint.SendWait.
- Communication subsystem implements observer pattern.
- WideStrings can be send over the communication channel.
- New event TOmniEventMonitor.OnTaskUndeliveredMessage is called after the task is terminated for all messages still waiting in the message queue.
- Implemented automatic event monitor with methods IOmniTaskControl.OnMessage and OnTerminated. Both support 'procedure of object' and 'reference to procedure' parameters.
- New unit OtlSync contains (old) TOmniCS and IOmniCriticalSection together with (new) OmniMREW - very simple and extremely fast multi-reader-exclusive-writer - and atomic CompareAndSwap functions.
- New unit OtlHooks contains API that can be used by external libraries to hook into OTL thread creation/destruction process and into exception chain.
- All known bugs fixed.
- 25_WaitableComm: Demo for ReceiveWait and SendWait.
- 26_MultiEventMonitor: How to run multiple event monitors in parallel.
- 27_RecursiveTree: Parallel tree processing.
- 28_Hooks: Demo for the new hook system.
- 29_ImplicitEventMonitor: Demo for OnMessage and OnTerminated, named method approach.
- 30_AnonymousEventMonitor: Demo for OnMessage and OnTerminated, anonymous method approach.
A teaser from demo 30
procedure TfrmAnonymousEventMonitorDemo.btnHelloClick(Sender: TObject);
btnHello.Enabled := false;
FAnonTask := CreateTask(
procedure (task: IOmniTask) begin
task.Comm.Send(0, Format('Hello, world! Reporting from thread %d',
procedure(const task: IOmniTaskControl; const msg: TOmniMessage) begin
lbLog.ItemIndex := lbLog.Items.Add(Format('%d:[%d/%s] %d|%s',
[GetCurrentThreadID, task.UniqueID, task.Name, msg.msgID,
procedure(const task: IOmniTaskControl) begin
lbLog.ItemIndex := lbLog.Items.Add(Format('[%d/%s] Terminated',
btnHello.Enabled := true;
FAnonTask := nil;