
21 Jan
2010
21 Jan
'10
6:19 p.m.
nevertheless, i would be happy to see spinlocks and reader-writer spinlocks as part of boost.thread. they could easily be implemented via boost.atomic.
can we implement it with test-and-test-and-set instead of just test-and-set? while (locked || XCHG(&locked, 1)) yield(); ie only do the memory barrier check if there is likelyhood of it succeeding. Tony