OmniThreadLibrary distribution includes plenty of demo applications that will help you get started. They are stored in the tests subfolder. This chapter lists all tests.
0_Beep:
The simplest possible OmniThreadLibrary threading code. 1_HelloWorld:
Threaded “Hello, World” with TOmniEventMonitor component created in run-time.2_TwoWayHello :
“Hello, World” with bidirectional communication; TOmniEventMonitor created in run-time. 3_HelloWorld_with_package:
Threaded “Hello, World” with TOmniEventMonitor component on the form. 4_TwoWayHello_with_package:
Hello, World with bidirectional communication; TOmniEventMonitor component on the form. 5_TwoWayHello_without_loop :
Hello, World with bidirectional communication, the OTL way.6_TwoWayHello_with_object_worker:
Obsolete, almost the same as demo 5_TwoWayHello_without_loop. 7_InitTest:
Demonstrates WaitForInit, ExitCode, ExitMessage, and SetPriority. 8_RegisterComm:
Demonstrates creation of additional communication channels. 9_Communications:
Simple communication subsystem tester. 10_Containers:
Full-blown communication subsystem tester. Used to verify correctness of the lock-free code. 11_ThreadPool:
Thread pool demo. 12_Lock:
Demonstrates WithLock.13_Exceptions:
Demonstrates exception catching. 14_TerminateWhen:
Demonstrates TerminateWhen and WithCounter. 15_TaskGroup:
Task group demo. 16_ChainTo:
Demonstrates ChainTo. 17_MsgWait:
Demonstrates MsgWait and Windows message processing inside tasks. 18_StringMsgDispatch:
Calling task methods by name and address. 19_StringMsgBenchmark:
Benchmarks various ways of task method invocation. 20_QuickSort:
Parallel QuickSort demo. 21_Anonymous_methods:
Demonstrates the use of anonymous methods as task workers in Delphi 2009. 22_Termination:
Tests for Terminate and Terminated. 23_BackgroundFileSearch:
Demonstrates file scanning in a background thread. 24_ConnectionPool:
Demonstrates how to create a connection pool with OmniThreadLibrary. 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.31_WaitableObjects:
Demo for the RegisterWaitObject/UnregisterWaitObject API.32_Queue:
Stress test for TOmniBaseQueue and TOmniQueue.33_BlockingCollection:
Stress test for the TOmniBlockingCollection, also shows the use of Environment to set process affinity.34_TreeScan:
Parallel tree scan using TOmniBlockingCollection.35_ParallelFor:
Parallel tree scan using ForEach (Delphi 2009 and newer).37_ParallelJoin:
ParallelJoin: Join demo.38_OrderedFor:
Ordered ForEach loops.39_Future:
Futures.40_Mandelbrot:
Very simple parallel graphics demo.41_Pipeline:
Multistage parallel processes using Pipeline.42_MessageQueue:
Stress test for TOmniMessageQueue.43_InvokeAnonymous:
Demo for IOmniTask.Invoke.44_Fork-Join QuickSort:
QuickSort implemented using Fork/Join.45_Fork-Join max:
Max(array) implemented using Fork/Join.46_Async:
Demo for Async abstraction.47_TaskConfig:
Demo for task configuration with Parallel.TaskConfig.48_OtlParallelExceptions:
Exception handling in high-level OTL constructs.49_FramedWorkers:
Multiple frames, each communicating with its own worker task. 50_OmniValueArray:
Wrapping arrays, hashes and records stored in TOmniValue.51_PipelineStressTest:
Pipeline stress test by [Anton Alisov].52_BackgroundWorker:
Demo for the Background worker abstraction.53_AsyncAwait:
Demo for the Async/Await abstraction.54_LockManager:
Lock manager (IOmniLockManager<K>) demo.55_ForEachProgress:
Demonstrates progress bar updating from a ForEach loop.56_RunInvoke:
Simplified ‘run & invoke’ low-level API.57_For:
Simple and fast Parallel for.58_ForVsForEach:
Speed comparison between ForEach, Parallel for, and TParallel.For (XE7+).59_TWaitFor:
Demo for the TWaitFor class.60_Map:
Demonstrates the Map abstraction.61_CollectionToArray:
Demonstrates the TOmniBlockingCollection.ToArray method.62_Console:
Demonstrates how to use OmniThreadLibrary from a console application.63_Service:
Demonstrates how to use OmniThreadLibrary from a service application.64_ProcessorGroups_NUMA:
Demonstrates how to work with processor groups and NUMA nodes. 65_TimedTask:
Demonstrates the TimedTask abstraction.66_ThreadsInThreads:
Demonstrates how to start OmniThreadLibrary threads from background threads.67_ArrayToCollection:
Demonstrates the use of TOmniBlockingCollection.FromArray and FromRange.