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. The so-called atomic ops effectively use the data item itself as the lock. For a single access this might be a gain because 'unlock' often needs another synchronising bus cycle. David -- David Laight: da...@l8s.co.uk