tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: RV-Predict bugs
Date Tue, 15 Sep 2015 19:06:50 GMT
> From: Yilong Li [] 
> Subject: Re: RV-Predict bugs

> > True, but as Mark previously pointed out, no one cares.  All that happens
> > in that case is the object is redundantly created and then garbage
> > collected later; no damage.

> No, it's not right. It's possible (although very unlikely) that this method
> could return null and results in a null pointer exception later.

Again, that cannot happen; see below.

> Intra-thread semantics says that event 3 (the first read of the field
> hashCode) happens before event 4 (the second read of field hashCode) but it
> has no effect on the value event 4 can see (because event 3 is also a read
> rather than a write).

You're mixing up inter- and intra-thread semantics and completely ignoring the write to hashCode
when the initially observed value is zero.  Intra-thread semantics require that operations
occur in program order, so the initial zero (or null) check results in a non-zero (or non-null)
write to the field of interest; control flow cannot be ignored here.  If your supposition
were correct, a compiler (or CPU) would be free to migrate actions dependent on a conditional
block to a spot prior to that conditional block - clearly that is nonsense.

 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message