Threadpool engine

Threadpool engine version 3.07

Author: Amine Moulay Ramdane

Description:

Thread Pool Engine.

Please read the HTML tutorial inside the zip file.

The following have been added:

  • A fast concurrent FIFO queue.
  • Enters in a wait state when there is no job in the queue - for more efficiency -
  • You can distribute your jobs to the workers threads and call any method with the threadpool's execute() method.
  • You can wait for the jobs to finish with the wait() method.
  • Now it can use processor groups on windows, so that it can use more than 64 logical processors.
  • It's NUMA-aware and NUMA efficient.

You have to know that to enlarge the stack of the worker threads of the Threadpool that use TThread, you have to set the stack size for the executable.

Look into defines.inc there is many options:

CPU32: for 32 bits architecture

CPU64: for 64 bits architecture

Language: FPC Pascal v2.2.0+ / Delphi 5+: http://www.freepascal.org/

Operating Systems: Win , Linux and Mac (x86).

Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal

-Sd for delphi mode....

Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi

Required Delphi XE-XE7 switch: -$H+ -DXE

For Delphi use -DDelphi

Please look at the examples test.pas,testpool.pas and test_thread.pas...

Note: testpool.pas is a parallel program of a Matrix multiply by a vector that uses SSE+ and it requires Delphi 5+. test.pas and test_thread.pas works with both FreePascal and Delphi.