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


Groups > comp.programming.threads > #2695

A very fast concurrent FIFO Queue 1 version 1.3

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Ramine <ramine@1.1>
Newsgroups comp.programming.threads
Subject A very fast concurrent FIFO Queue 1 version 1.3
Date Fri, 21 Nov 2014 12:55:35 -0800
Organization A noiseless patient Spider
Lines 60
Message-ID <m4nu8l$m2f$6@dont-email.me> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Fri, 21 Nov 2014 17:54:29 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="1ae5840e55f7298da80ae7cf67a723cd"; logging-data="22607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UX75Kyp691hG+rzUhLokV"
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
Cancel-Lock sha1:7Gqju8+THoQVWq54mYUQpb/gpiQ=
Xref csiph.com comp.programming.threads:2695

Show key headers only | View raw


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-fifo-queue-1


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

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.

Back to comp.programming.threads | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

A very fast concurrent FIFO Queue 1 version 1.3 Ramine <ramine@1.1> - 2014-11-21 12:55 -0800
  Re: A very fast concurrent FIFO Queue 1 version 1.3 Tom <mail2devnull@web.de> - 2014-11-24 15:17 +0100

csiph-web