Prev: Trying to build Gnat on MACOSX 10.5 PPC
Next: ANNOUNCE: Evex 0.50, Evaluation Expression for and in Ada
From: aminer on 27 Mar 2010 13:11 Hello all, Note: Object Pascal looks like ADA and you can port Threadpool's algorithm to ADA... I have updated Threadpool to version 1.3 - a stable version - http://pages.videotron.com/aminer/threadpool.htm Lock-free ParallelQueuerb and lock-free RingBuffer have been added Author: Amine Moulay Ramdane Language: FPC Pascal v2.2.0+ / Delphi 5+: http://www.freepascal.org/ Operating Systems: Win , Linux and Mac (x86). Description: Lock-free Thread Pool Engine. The following have been added: -- Lockfree ParallelQueue for less contention and more efficiency or it can use lockfree_mpmc - flqueue that i have modified, enhanced and improved... - ... - It uses a lock-free queue for each worker thread and work- stealing - for more efficiency - - The worker threads enters in a wait state when there no job in the lock-free queues - for more efficiency - - You can distribute your jobs to the worker threads and call any method with the threadpool's execute() method. Look into defines.inc there is many options: ParallelQueue: it uses lock-free ParallelQueue - very efficient - Lockfree_MPMC: it uses lockfree_MPMC ParallelQueuerb: it uses lock-free ParallelQueuerb (New) RingBuffer: it uses lock-free RingBuffer (New) SINGLE_PRODUCER: for a single producer (thread) MUTIPLE_PRODUCER: mutiple producer (threads) CPU32: for 32 bits architecture Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ Please look at the examples test.pas,test_pool.pas and test_thread.pas insode the zip... Note: test_pool.pas does require Delphi 5+, test.pas and test_thread.pas works with both FreePascal and Delphi You can download the new and stable version 1.3 from: http://pages.videotron.com/aminer/ My Threadpool is VERY easy to use, and here is a page that i wrote about it: http://pages.videotron.com/aminer/threadpool.htm Sincerely, Amine Moulay Ramdane. |