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


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

And improved algorithm of a concurrent FIFO queue

Started byaminer <aminer@toto.net>
First post2014-05-06 20:42 -0700
Last post2014-05-07 05:38 +0200
Articles 3 — 3 participants

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


Contents

  And improved algorithm of a concurrent FIFO queue aminer <aminer@toto.net> - 2014-05-06 20:42 -0700
    Re: And improved algorithm of a concurrent FIFO queue "Chris M. Thomasson" <no@spam.invalid> - 2014-05-06 18:59 -0700
      Re: And improved algorithm of a concurrent FIFO queue Melzzzzz <mel@zzzzz.invalid> - 2014-05-07 05:38 +0200

#2305 — And improved algorithm of a concurrent FIFO queue

Fromaminer <aminer@toto.net>
Date2014-05-06 20:42 -0700
SubjectAnd improved algorithm of a concurrent FIFO queue
Message-ID<lkbvi7$588$1@news.albasani.net>
Hello,

I have improved more my previous algorithm of a very fast concurrent 
FIFO queue, the getlength() method was generating two much cache-line 
transfers, so i have optimize it more and getlength() is now generating 
much less cache-line transfers, so the throughput have improved and it
my new and improved algorithm has now 50% better throughput on the pop() 
side than the following Chris Thomasson concurrent FIFO queue that uses 
the bakery algorithm, and it has the same throughput on the push() side 
than the following Chriss Thomasson concurrent FIFO Queue.

Here is the Chris Thomasson algorithm:

https://groups.google.com/forum/#!topic/lock-free/acjQ3-89abE/discussion


And here is my new and improved algorithm:

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

I have included inside the zipfile two variants of my concurrent FIFO 
queue, there is a file called WQueue.pas that is only starvation-free on 
the pop() side and there is a file called WSFQueue.pas that is fully 
starvation-free.

You can download my new and improved algorithm of a very fast concurrent 
FIFO queue version 1.2 from:


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



Thank you,
Amine Moulay Ramdane.


[toc] | [next] | [standalone]


#2308

From"Chris M. Thomasson" <no@spam.invalid>
Date2014-05-06 18:59 -0700
Message-ID<lkc41r$ehc$1@speranza.aioe.org>
In reply to#2305
> "animer":

> my new and improved algorithm has now 50% better throughput on the pop() 
> side than the following Chris Thomasson concurrent FIFO queue that uses 
> the bakery algorithm, and it has the same throughput on the push() side 
> than the following Chriss Thomasson concurrent FIFO Queue.

50% better throughput on the pop side! AFAICT, that is a total
crock of fuc%ing bullshi%! Anyway, what the hell are all of those
nasty Sleep(0)'s littered around your code?

BTW, can you tell me the usage pattern for an eventcount? I
have doubts that you know how to properly use one, let alone
implement one.


FWIW, here my first implementation of an eventcount here back
in 2005

https://groups.google.com/d/topic/comp.programming.threads/qoxirQbbs4A/discussion


Joe Seigh has some excellent feedback dealing with the proper
memory barriers and common usage pattern in the thread...


Now, learn the basics' of this stuff, and leave my name out of
it in the meantime!

Personally, I don't trust ANY of your code because you fail to at
least try to check it against verification tools. 

[toc] | [prev] | [next] | [standalone]


#2310

FromMelzzzzz <mel@zzzzz.invalid>
Date2014-05-07 05:38 +0200
Message-ID<lkc9sd$qf$1@solani.org>
In reply to#2308
On Tue, 6 May 2014 18:59:07 -0700
"Chris M. Thomasson" <no@spam.invalid> wrote:

> > "animer":
> 
> > my new and improved algorithm has now 50% better throughput on the
> > pop() side than the following Chris Thomasson concurrent FIFO queue
> > that uses the bakery algorithm, and it has the same throughput on
> > the push() side than the following Chriss Thomasson concurrent FIFO
> > Queue.
> 
> 50% better throughput on the pop side! AFAICT, that is a total
> crock of fuc%ing bullshi%! Anyway, what the hell are all of those
> nasty Sleep(0)'s littered around your code?

I guess that he expects same behavior both on Unices and Windows.
This is not the case. He should use sched_yield at least on Linux...


-- 
Click OK to continue...

[toc] | [prev] | [standalone]


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


csiph-web