On Sat, Jul 30, 2011 at 10:16:30PM +0100, David Laight wrote: > On Sat, Jul 30, 2011 at 11:04:24PM +0200, Joerg Sonnenberger wrote: > ... > > Note that for a uncontested resource, the overhead of a mutex for a > > single operation tends to be comparable, if store fences have a similar > > price than bus locked operation on an owned cache line. > > I remember being told that you couldn't avoid a lock, and algorithms > that claimed to do so were broken.
You can avoid some properties of a lock. E.g. if you are using a lock-free queue in shared memory, you can completely kill a process at any point and the queue will still be in a consistent state. Joerg