On Monday, December 03, 2012, Leif Walsh wrote:
> I have a memory location whose behavior I'd like to verify with helgrind
> and/or drd, but which I access in a racy way sometimes.  I would like to
> ignore the race I know about but still have it checked for other accesses.
>  Is this possible?
> 
> The race is that, while a thread has a read lock, it may set the value to
> 1, but it does not read the value.  While a thread has a write lock, it may
> read the value and it may set the value to 0.  The race is that many
> threads can set it to 1 if they all have the read lock.  DRD and helgrind
> tend to view this as a race.

Correctly, IMO.  Why do you think this behaviour is OK ?  If you have
a read lock, you can read the location, but not write it.

Were you trying to achieve some larger goal, such as (at a guess) the 
thread with the write lock creates a description of some work to be done
(in an object in memory) and multiple threads with read locks compete to
do that work, and write into the location you mentioned, in order to show
that they have completed it?

J

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to