Recent

Author Topic: PThreadpool version 1.5  (Read 2168 times)

aminer

  • Hero Member
  • *****
  • Posts: 956
PThreadpool version 1.5
« on: June 26, 2013, 03:50:28 pm »

Hello,

Threadpool with priorities 1.5 (stable version), now you can
use it as a scalable priority MPMC FIFO queue.


Author: Amine Moulay Ramdane


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

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

Description:

Thread Pool Engine.

The following have been added:

- You can give the following priorities to jobs:

LOW_PRIORITY
NORMAL_PRIORITY
HIGH_PRIORITY

- A lock-free queue for each worker thread and it uses work-stealing - for more efficiency -

- Enters in a wait state when there no is 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.

- Uses O(1) complexity on enqueue and O(3) complexity worst case on dequeue.

Look into defines.inc there is many options:

CPU32: for 32 bits architecture
CPU64: for 64 bits architecture

Please read an article that i wrote about my Threadpool engine: article.

Look at test1.pas example inside the zip file, to show you how to use pthreadpoop engine as a scalable priority MPMC FIFO queue, with this same method  you can implement a  scalable priority MPMC FIFO queue.


You can download PThreadpool version 1.5 from:

http://pages.videotron.com/aminer/



Thank you,
Amine Moulay Ramdane.


aminer

  • Hero Member
  • *****
  • Posts: 956
Re: PThreadpool version 1.5
« Reply #1 on: June 26, 2013, 04:46:35 pm »

Hello,

Now that i have implemented PThreadpool engine
and showed you how to use it as a scalable MPMC priority queue,
would you want me to implement with this method a fully scalable
MPMC priority queue ? It's easy to do it now with the same
method as my PThreadpool.

I think i will do it for you, and show you how to implement
a scalable MPMC priority queue and a scalable MPMC queue and
a scalable stack using the same method as my PThreadpool engine.



Thank you,
Amine Moulay Ramdane.


 

TinyPortal © 2005-2018