Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #2244 > unrolled thread

A fast concurrent FIFO Queue that uses a two locks algorithm...

Started byaminer <aminer@toto.net>
First post2014-04-24 14:34 -0700
Last post2014-04-24 14:37 -0700
Articles 2 — 1 participant

Back to article view | Back to comp.programming.threads


Contents

  A fast concurrent FIFO Queue that uses a two locks algorithm... aminer <aminer@toto.net> - 2014-04-24 14:34 -0700
    Re: A fast concurrent FIFO Queue that uses a two locks algorithm... aminer <aminer@toto.net> - 2014-04-24 14:37 -0700

#2244 — A fast concurrent FIFO Queue that uses a two locks algorithm...

Fromaminer <aminer@toto.net>
Date2014-04-24 14:34 -0700
SubjectA fast concurrent FIFO Queue that uses a two locks algorithm...
Message-ID<ljblf8$ck2$1@news.albasani.net>
Hello,

A fast concurrent FIFO Queue that uses a two locks algorithm...


Authors: Amine Moulay Ramdane


Description:

A concurrent FIFO queue that satisfies many requirements: it is FIFO 
fair, it minimizes efficiently the cache-coherence traffic and it is 
energy efficient on the pop() side: when there is no items in the queue 
it will not spin-wait , but it will block wait on my SemaMonitor.

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 Spinlock gives better performance under contention it scored 12.5 
millions of transactions per second on my 2.4 GHz Quadcore, the Ticket 
Spinlock option scored 3.2 millions of transactions per second on my 2.4 
GHz Quadcore, the Spinlock scaled even if the number of threads are 
greater than the number of cores, the TicketSpinlock and AMLock don't 
scale when the number of threads are greater than the number of cores, 
the Ticket Spinlock and scalable AMLock are optimal when the number of 
threads are equal to the number of cores.

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

Please take a look a the test.pas Object Pascal demo inside the zipfile, 
compile and run it...

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

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


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

-Sd for delphi mode....

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

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




Thank you,
Amine Moulay Ramdane.

[toc] | [next] | [standalone]


#2245

Fromaminer <aminer@toto.net>
Date2014-04-24 14:37 -0700
Message-ID<ljbll2$ck2$4@news.albasani.net>
In reply to#2244
You can download this fast concurrent FIFO Queue from:

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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming.threads


csiph-web