On 11/25/2014 10:22 AM, Pohl, Hartmut wrote:

> What confuses me is that the stack trace incorrectly reports a data race
> between the first and the second test thread. Which is impossible and makes me
> think that maybe the pthread_join() is incorrectly handled by helgrind?

There are a bunch of stack traces in this message.  Exactly which one is
the one you think is wrong?

I don't exactly understand the test program, but this ..

>   bool wait = true;
>   do
>   {
>     wait = atomicWait.syncLoad();
>     ANNOTATE_HAPPENS_AFTER(atomicWait.getAddress());    
>   }
>   while (wait) ;

.. doesn't feel right to me.  You need to put the ANNOTATE_HAPPENS_AFTER
after the end of the while loop, not inside it, because merely reading
the value

>     wait = atomicWait.syncLoad();

doesn't mean the thread can go forwards.  It has to spin until that
value becomes |true|.  So the h-b edge from the main thread "arrives
here" after the loop, not inside it.

J


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to