[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lock Free Algorithms
- From: Dave Dodge <dododge@...>
- Date: Fri, 3 Mar 2006 03:42:16 -0500
On Tue, Feb 28, 2006 at 10:26:27AM +1100, D Burgess wrote:
> 2) a set of ANSI C basic "lock free" containers lists, queues (LIFO, FIFO)
> would be a perfect world.
Bear in mind that the ANSI/ISO C standard doesn't even have the basic
concept of concurrency.
> > - You still need machine-specific primitives (compare-and-swap
> > and memory barriers). It's not very portable.
Not only that, but different machines provide different primitives, so
if you're aiming for best performance you should really tune the
entire algorithm to what the machine makes available: LL/SC, CMPXCHG,
the number of bits of atomicity, alignment constraints, cache line
size, cache coherency details, and so on.