
Lars Gullik Bjønnes wrote: [...]
| http://www.boost.org/boost/detail/lwm_gcc.hpp is also broken.
Because of the sched_yield or something else?
Yes (plus the issue of memory barriers).
Perhaps the lwm_gcc should just be removed? (and lwm_linux)
Yes, definitely.
In the lwm_linux case futexes could be used if new enough glibc and kernel.
No need for new enough glibc; only new enough kernel (one with sensible and correct futex impl -- probably 3.2.something ;-) ), I think.
(OTOH in that case it is likely that pthread's mutex is implement with futex)
Current impl aside for a moment, pthread_mutex_t does some dispatching because it represents multiple mutex types. A "lightweight mutex" doesn't need really that. Well, I guess that boost simply needs standard atomic<> template -- for something along the lines of www.terekhov.de/pthread_refcount_t/experimental/refcount.cpp regards, alexander.