From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-07-20 09:24:27
Alexander Terekhov wrote:
> Peter Dimov wrote:
>> Here's TryEnterCriticalSection (-recursivity) for reference:
>> bool try_lock( critical_section * p )
>> return atomic_compare_exchange( p->LockCount, -1, 0 ) == 0;
> The point of "swap based mutex" exercise was to avoid CAS because
> i386 doesn't have it. With CAS (and absent timedlock operation),
> it can be made safe and fast (better than MS "critical" stuff).
Why is i386 support important (for a Windows mutex implementation, I mean)?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk