tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: RV-Predict bugs
Date Wed, 16 Sep 2015 01:39:10 GMT
> From: David Jencks [mailto:david_jencks@yahoo.com.INVALID] 
> Subject: Re: RV-Predict bugs

> I have been having a hard time believing the reordering claims, but finally I went to
Jeremy's 
> blog post.  To recap, he says 

> if (hash == 0) {
>   int h = //compute hash
>   hash = h;
> }
> return hash;

> can be reordered to

> r1 = hash;
> if (hash == 0) {
>   r1 = hash = // calculate hash
> }
> return r1;

> Obviously this last version is susceptible to returning 0.

> It looks to me like the 2nd version is not a reordering of the java statements of the
first version.

Correct; it's different logic, and thus a bit of a red herring.  It introduces a timing window
not present in the original code; it's not an example of a speculative read.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message