[cpp-threads] Somewhat relevant technical report

Peter Dimov pdimov at mmltd.net
Sat Dec 17 13:59:08 GMT 2005


Boehm, Hans wrote:
> I think we're trying to say different things, and perhaps the footnote
> should be rephrased.
>
> We basically have, in Posix terms:
>
> T1: v1 = 1; pthread_mutex_lock(&l1);
>
> T2: pthread_mutex_trylock(&l1) fails; r2 = v1;
>
> The question is whether r2 is guaranteed to be 1.
>
> As I see it, the only reason this might not be guaranteed is that
> pthread_mutex_try_lock doesn't guarantee memory synchronization in
> this case.
>
> It's unclear what that statement means.

To me it means exactly what it says. A failed pthread_mutex_trylock is a 
no-op with respect to memory synchronization and visibility, a { return 
false; }. 




More information about the cpp-threads mailing list