RFR 8049220: URL.factory data race
peter.levart at gmail.com
Mon Jul 7 11:07:27 UTC 2014
Hi Pavel, Alan and Paul,
Thanks for reviewing. I accepted the suggestions from Pavel and Paul and
Is this good to go into jdk9-dev?
On 07/04/2014 04:54 PM, Paul Sandoz wrote:
> On Jul 3, 2014, at 6:33 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>> On 03/07/2014 09:43, Peter Levart wrote:
>>> I noticed a data race in java.net.URL:
>>> I propose the following simple patch:
>> A good catch and the change looks good to me.
> Yes, well spotted. May i suggest that the following comment is updated:
> 1109 factory = fac; // volatile write
> to say something about ensuring safe publication of a constructed handle? since it is often quite tricky to reason about why a volatile write is needed (to stamp in, at least, a StoreStore barrier).
> For JMM v9 we may not need to mark such a ref as volatile.
>> I assume it just wasn't noticed because it can only be set once and probably rared used too.
> Yeah, i wonder whether it would ever get optimized/inlined to the point at which re-ordering could practically happen.
More information about the core-libs-dev