|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2004-01-29 09:28:20
Howard Hinnant wrote:
[...]
> Alexander, I have no doubt that you will see problems with this
> implementation, and I appreciate your comments.
Get rid of yield. With yield you basically have a spinlock, not a
general purpose mutex. Think of a uniprocessor [under priority
scheduling rules] with some higher priority thread contending for
a lock currently owned by some lower priority thread.
> Could you please
> comment specifically on how the lwarx, stwcx., isync and sync
> instructions do not address your concerns, thanks.
Use of op+isync for "op.hoist_load+hoist_store" (aka op.acquire)
seem to be what everyone is doing out there (looks a bit strange
if you ask me). For "op.sink_load+sink_store" (aka op.release)
you can use lwsync+op (lightweight, oh well, form of sync).
www-106.ibm.com/developerworks/eserver/articles/powerpc.html
listman.redhat.com/archives/phil-list/2003-August/msg00039.html
regards,
alexander.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk