[cpp-threads] D2335 (sequential consistency proof) revision

Peter Dimov pdimov at mmltd.net
Fri Aug 24 22:56:41 BST 2007


Boehm, Hans:

> Here's another possible way out of this.  I'm not 100% sure this is
> correct yet, but it seems like it on first glance:
>
> We allow trylock and timedlock to fail spuriously, even if the lock was
> never held.

I've found this specification a good idea in general for try_ operations. 
For example, a failed try_pop operation for a queue doesn't guarantee that 
the queue was empty; it might just have failed to try_lock an internal 
mutex.

If you make try_* failures guarantee state, you might no longer guarantee 
that they never block. 




More information about the cpp-threads mailing list