[concurrency-interest] On A Formal Definition of 'Data-Race'

Brian Goetz brian at briangoetz.com
Sun Apr 14 13:23:08 EDT 2013


The "long or double" part is irrelevant.  People get all torn up about 
word-tearing -- as if it somehow was a case unto itself -- but even if 
long/double reads/writes were guaranteed tear-free, it would *still* be 
a data race if the variable is not volatile.  The word-tearing risk 
simply expands the set of "bad things that can happen in a data race" 
from "could read stale values" to "could read half-stale values."

On 4/13/2013 11:04 PM, ys wrote:
> Is "this.shared" a non-volatile long or double? If so, how would it not
> be racy? And if not, isn't there precedent to declare it a benign race
> (rather than not a race at all)?
>
>
> On Sat, Apr 13, 2013 at 9:42 PM, thurstonn <thurston at nomagicsoftware.com
> <mailto:thurston at nomagicsoftware.com>> wrote:
>
>     Before I answer fully, let me ask you about another variant of the
>     program:
>
>
>     Thread 1                     Thread 2
>     this.shared = 10            local = this.shared
>
>     Is this "racy"?  Clearly there is no explicit happens-before.  But,
>     at least
>     in my reading of the (your) definition that I quoted in my OP, it
>     wouldn't
>     qualify as a data-race.
>
>
>
>     --
>     View this message in context:
>     http://jsr166-concurrency.10961.n7.nabble.com/On-A-Formal-Definition-of-Data-Race-tp9408p9413.html
>     Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
>     _______________________________________________
>     Concurrency-interest mailing list
>     Concurrency-interest at cs.oswego.edu
>     <mailto:Concurrency-interest at cs.oswego.edu>
>     http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>


More information about the Concurrency-interest mailing list