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


Groups > comp.programming > #3871 > unrolled thread

waitfree and lockfree queue...

Started byaminer <aminer@toto.net>
First post2013-10-07 15:45 -0700
Last post2013-10-07 15:45 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.programming


Contents

  waitfree and lockfree queue... aminer <aminer@toto.net> - 2013-10-07 15:45 -0700

#3871 — waitfree and lockfree queue...

Fromaminer <aminer@toto.net>
Date2013-10-07 15:45 -0700
Subjectwaitfree and lockfree queue...
Message-ID<l2v304$sv5$1@news.albasani.net>
Hello,

I have took a look at the following FIFO MPMC queue
that Dmitry Vyukov and Chris Thomasson wrote, and i have understood
it very well, this FIFO queue is Waitfree on the push() side
but Lockfree on the pop side... but what i don't like is that
on the pop() side when there is high contention , there will be
too many cache misses and cache lines transfer and this
will be so bad ... in a worst case scenario when the threads will be 
looping
and all crossing the "node next = cmp.m_next;" there will be progress 
but i think this FIFO queue will have to tranfer
1+2+3+4+ ..N = ((N^2+N)/2) cache lines or even worse N+N+N+N...N = N^2 
from the memory and this will be
so bad, this is what i don't like, so to lower much those cache lines 
tranfer the FIFO queue must be Waitfree on both the push() and the pop().

Here is the FIFO queue:

http://pastebin.com/f72cc3cc1


Amine Moulay Ramdane.

[toc] | [standalone]


Back to top | Article view | comp.programming


csiph-web