[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

A very fast concurrent FIFO Queue 1 version 1.3

Ramine

11/21/2014 8:55:00 PM


Hello,


A very fast concurrent FIFO Queue 1 version 1.3


Authors: Amine Moulay Ramdane


Description:

A very fast concurrent FIFO queue that satisfies many requirements: it
has more parallelism than the two locks algorithm, it is FIFO fair ,
it's starvation-free and it minimizes efficiently the cache-coherence
traffic and it is 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 it will not spin-wait , but it will block wait on my SemaMonitor,
and when the wait parameter of the constructor is set to false it uses
only an atomic increment on the push() side and an atomic increment on
the pop() side, so it's very fast. The number of threads on the push()
side are limited by the length of the queue, and the number of threads
on the pop() side are limited by the length of the queue, the length of
the queue must be greater or equal to 2^10, i have set it like that.

You have 3 options for setting the kind of locks, just look inside
defines.inc , if you want to set it for my array based lock called
AMLock just uncomment the option AMLock 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,
the Ticket Spinlock option scored 12.5 millions of transactions per
second on my 2.4 GHz Quadcore.

The size of the queue must be passed to the constructor and it must be a
power of 2.


You an download it from:

https://sites.google.com/site/aminer68/concurrent-fi...


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

Operating Systems: Windows, Mac OSX , Linux...

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

-Sd for delphi mode....

Required Delphi switches: -$H+ -DDelphi

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

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



Thank you,
Amine Moulay Ramdane.