Re: [GD-General] Totally Safe lock-free FIFO for arbitrary-sized items.
Brought to you by:
vexxed72
|
From: Jon W. <hp...@mi...> - 2006-08-21 02:40:26
|
Andras Balogh wrote:
> To answer your question, when I asked for a 64 bit FIFO, I was thinking of
> the fully generic FIFO's on 64bit systems, with unlimited queue length,
> and with multiple producer and consumer threads. In this case, all the
> solutions that I've found used linked lists with pointers, and required
> using an atomic compare-and-swap primitive that works on double the
> machine word size (so that you can use another machine word for ABA
> resolution), which is non existent for 64 bit systems (there's no
> cmpxchg16b AFAIK), hence my question.
>
Yes, if you want that, you'll need locking. Sucks but true.
Which is why I much prefer the single-writer, single-reader FIFO, which
solves 95% of the actual cases :-)
Cheers,
/ h+
|