[cpp-threads] Somewhat relevant technical report

Alexander Terekhov alexander.terekhov at gmail.com
Mon Dec 19 07:06:50 GMT 2005


On 12/18/05, Peter Dimov <pdimov at mmltd.net> wrote:
> Alexander Terekhov wrote:
> > On 12/17/05, Peter Dimov <pdimov at mmltd.net> wrote:
> > [...]
> >> Interesting, but... doesn't checking the old thread id require a
> >> hoist-load? You could read "previous previous owner" instead of
> >> "previous owner" otherwise, if the read is hoisted above the lock
> >> acquisiton...
> >
> > Lock/unlocked bit and owner id can be kept in the same memory
> > location.
>
> Nice.
>
> But it still doesn't help, we can insert a dummy lock+unlock l2 in T1 before
> everything else, and the problem with v1 remains. :-)

Not if implementation is allowed to inject if "try_lock(l2) not failed
unlock(l2);" in T2 "before everything else" or at some other point. I
believe that it is allowed.

regards,
alexander.



More information about the cpp-threads mailing list