Concurrent FIFO Queue 1

Concurrent FIFO queue 1

A fast concurrent FIFO Queue and a fast concurrent priority FIFO Queue version 1.45, they are node based and unbounded.

Author: Based on Dmitry Vyukov concurrent FIFO queue

Email: aminer@videotron.ca

Description:

A fast concurrent FIFO queue and a fast concurrent priority FIFO queue that satisfy many requirements: they have more parallelism than the two locks algorithm, they are waitfree and starvation-free and FIFO fair on the push() side and they are FIFO fair on the pop(), and they minimizes efficiently the cache-coherence traffic and they are energy efficient on the pop() side when you set the wait parameter to true in the construtor: when there is no items in the queue they will not spin-wait , but they will block wait on my SemaMonitor, and when the wait parameter of the constructor is set to false they uses only an atomic increment on the push() side and a CAS and a lock on the pop() side, so they are fast, those concurrent FIFO queues are more scalable.

You have 5 options for setting the kind of locks, just look inside defines.inc , if you want to set it for the Mutex that is energy efficient because it blocks the threads, uncomment the option Mutex,if you want to set it for my scalable array based lock called AMLock just uncomment the option AMLock inside defines.inc, if you want to set it for my scalable lock called MLock just uncomment the option MLock inside defines.inc, if you want to set it for Ticket Spinlock just uncomment the option TicketSpinlock ,If you want to set it for Spinlock just uncomment the option Spinlock.

You can go to download the zip files by clicking on the following web link:

https://drive.google.com/drive/folders/1EETPDtl6VIWEX7mnPdWQtoSRREfhNuft?usp=sharing

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

Operating Systems: Windows, Mac OSX , Linux on (x86)...

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

-Sd for delphi mode....

Required Delphi switches: -$H+ -DDelphi

For Delphi XE-XE7 use the -DXE switch

{$DEFINE CPU32} and {$DEFINE Windows32} for 32 bit systems

{$DEFINE CPU64} and {$DEFINE Windows64} for 64 bit systems