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

Mike Duigou mike.duigou at oracle.com
Tue Apr 16 15:58:12 EDT 2013

It's been a practice for a while in OpenJDK maintenance to document benign races like String.hash initialization and class statics like Collections.r whenever they are noted.

Whenever you see an uncommented race condition in JDK code as part of a review please request that a comment be added.

If the race condition is surprising or non-obvious and important it's possible to create bug issue/patches just to document it. (Which has been done in at least one case I remember).


On Apr 16 2013, at 12:33 , oleksandr otenko wrote:

> Technically, setting hash value is racy. It is the same value, but the writes race.
> Alex
> On 16/04/2013 19:57, thurstonn wrote:
>> Just curious, how is String#hashCode() racy?
>> Strings are immutable in java; I looked at the code a bit and I didn't see
>> anything that looked racy.
>> The only thing I guess could be:
>> private char[] value
>> Although that array is never modified in the String class, so . . .
> _______________________________________________
> 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/20130416/7c57b139/attachment.html>

More information about the Concurrency-interest mailing list