31 Mar
2011
31 Mar
'11
5:49 p.m.
AMDG On 03/31/2011 09:55 AM, Panagiotis Foteinos wrote:
I looked into the documentation, but it is still unclear to me.
When a thread locks() an already acquired mutex, does it block (i.e. does it do nothing?) releasing all the resources or it loops wasting cpu cycles that another thread could utilize? In other words, is boost's locking mechanism blocking or spinning?
It's an implementation detail. You realize that the two aren't necessarily mutually exclusive? Anyway, Boost.Thread does block on an Event. A spin-lock only makes sense on a multi-core system. In Christ, Steven Watanabe