Re: [Valgrind-users] helgrind and threadsafe-statics

2014-06-20 Thread David Faure
On Monday 09 June 2014 08:39:45 Patrick J. LoPresti wrote: Interesting! So on x86 and similar, they implement thread-safe Meyers singletons via the double-checked locking anti-pattern... Which is actually safe thanks to Intel's not-exactly-relaxed memory model. Interesting indeed. If g++

Re: [Valgrind-users] helgrind and threadsafe-statics

2014-06-09 Thread Bart Van Assche
On 06/08/14 19:09, David Faure wrote: I'm using helgrind quite a lot these days, and I love it. However I wonder if it doesn't give me false positives for the case of reading a value from a static object, which was set in the constructor. Given that gcc does indeed implement threadsafe

Re: [Valgrind-users] helgrind and threadsafe-statics

2014-06-09 Thread Bart Van Assche
On 06/09/14 13:16, Olivier Goffart wrote: On Monday 09 June 2014 09:53:37 Bart Van Assche wrote: If g++ would be modified such that the if (!guard.first_byte) test can be skipped at run-time then it would become possible for Helgrind and DRD to recognize static initialization by intercepting

Re: [Valgrind-users] helgrind and threadsafe-statics

2014-06-09 Thread Patrick J. LoPresti
On Mon, Jun 9, 2014 at 12:53 AM, Bart Van Assche bvanass...@acm.org wrote: I think g++ will have to be modified to allow Helgrind and DRD to recognize thread-safe statics on architectures that do not have relaxed memory consistency. From the gcc source file gcc/cp/decl.c I derived that on

[Valgrind-users] helgrind and threadsafe-statics

2014-06-08 Thread David Faure
Hello, I'm using helgrind quite a lot these days, and I love it. However I wonder if it doesn't give me false positives for the case of reading a value from a static object, which was set in the constructor. Given that gcc does indeed implement threadsafe statics as per C++11 (but even before