RFR (XXS): 8066896: Update c.o.j.t.InfiniteLoop to skip zero timeout
pavel.chistyakov at oracle.com
Fri Dec 19 20:12:23 UTC 2014
thank you for review.
----- Original Message -----
From: vladimir.kozlov at oracle.com
To: pavel.chistyakov at oracle.com
Cc: hotspot-compiler-dev at openjdk.java.net
Sent: Friday, December 19, 2014 10:16:17 PM GMT +04:00 Abu Dhabi / Muscat
Subject: Re: RFR (XXS): 8066896: Update c.o.j.t.InfiniteLoop to skip zero timeout
I googled it and it explained that Thread.sleep(0) is not free.
I am fine with this change.
On 12/18/14 9:52 PM, Pavel Chistyakov wrote:
> Hi, Vladimir
> It's a little confusing corner case: to call sleep w/ 0 (zero) => expecting not to have any pause.
> If we call sleep w/ any other value then we expect some pause.
> So, in this case we need to prevent any pause. For this reason I added a conditional sleep call.
> ----- Original Message -----
> From: vladimir.kozlov at oracle.com
> To: hotspot-compiler-dev at openjdk.java.net
> Sent: Friday, December 12, 2014 12:57:29 AM GMT +04:00 Abu Dhabi / Muscat
> Subject: Re: RFR (XXS): 8066896: Update c.o.j.t.InfiniteLoop to skip zero timeout
> Why it is a problem?
> * Class which runs another Runnable in infinite loop with certain pauses
> * between cycles.
> It does not say that it will not pause for few instructions to execute Thread.sleep(0).
> On 12/9/14 8:50 AM, Pavel Chistyakov wrote:
>> Hi all,
>> please review changes for: https://bugs.openjdk.java.net/browse/JDK-8066896
>> webrev: http://cr.openjdk.java.net/~iignatyev/pchistyakov/8066896/webrev.00/
>> InfiniteLoop allows zero value as timeout and waste time for Thread.sleep(0) call that is not needed in this case.
>> Add a condition for skipping 0 (zero) timeout when calling Thread.sleep
>> Testing: manual
More information about the hotspot-compiler-dev