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

oleksandr otenko oleksandr.otenko at oracle.com
Mon Apr 15 12:37:02 EDT 2013


happens-before is sooo misunderstood!..

What do you mean - "no explicit happens-before"? happens-before doesn't 
create barriers "between threads"; volatile or not, locked or not, there 
is no order enforced between the first and the second thread. 
happens-before is a *reasoning mode* about visibility of effects from 
another thread.

In this example, you need to show:

this.shared was 0.

this.shared = 10               local = this.shared;

if (local == 10) "this.shared = 10" happens-before "local = this.shared"
else unknown


Alex


On 14/04/2013 02:42, thurstonn 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
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130415/a971b5f7/attachment.html>


More information about the Concurrency-interest mailing list