On Fri, 2015-08-07 at 10:36 -0400, Rich Prohaska wrote:
> Hello,
> 
> I have observed that helgrind will report erroneous data races on a
> variable if checking on that variable is disable and enabled by a
> concurrent thread.  Can someone explain what is going on?
VALGRIND_HG_ENABLE_CHECKING implementation consists in declaring
that the address range is 'new' and belongs (exclusively) to this
thread. In other words, calling VALGRIND_HG_ENABLE_CHECKING
is like if the memory was just allocated.

So, using that definition, it is normal that helgrind reports
a race, because there is no synchronisation between the thread
that 'allocated freshly' count, and the thread that does a write
to count.

Philippe



------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to