RFR (S): Fix for JDK-6546236 made Solaris os::yield() a no-op

David Holmes david.holmes at oracle.com
Wed Jul 9 02:11:33 UTC 2014


Hi Fred,

I don't think the change to naked_yield over yield was really needed 
once there was only a single "yield" call. But ok.

I'm not convinced that the Solaris behaviour under thr_yield is exactly 
the same as we had under the old os::sleep either. As I recall the old 
behaviour always gave up the CPU, whereas thr_yield need not. The 
difference would depend on scheduling class though; and it would seem to 
be more a potential performance issue than a correctness one. So okay again.

Cheers,
David

On 7/07/2014 10:08 PM, Frederic Parain wrote:
> Greetings,
>
> Fix for JDK-6546236 merged the Solaris os::sleep() implementation with
> the shared POSIX implementation. However, Solaris code used to call
> os:sleep(Thread::current(), 0, false) to implement os::yield(), and the
> os::posix::sleep() method returns immediately if its time argument is
> zero, which makes the Solaris os::yield() method a no-op.
>
> This changeset fixes that with other clean up:
>
>    1) Solaris os::yield() was changed to call NakedYield() instead
>       of os:sleep(Thread::current(), 0, false). I made this change
>       to make its implementation consistent with other POSIX
>       platform and also because the change of os::yield() into
>       a no-op didn't show any regression (so, the short sleep
>       required in the past doesn't look necessary anymore).
>
>    2) Once Solaris os::yield() has been changed to call NakedYield()
>       the JVM had two different methods to call the yield system
>       call: os::yield() and os::NakedYield(). I replaced those
>       methods with a new method called os::naked_yield(). This
>       renaming aims to: avoid confusion with the old os::yield()
>       methods and its weird implementation and fix naming style
>       of os::NakedYield() method.
>
>    3) I removed the unused enum type YieldResult, which only
>       matters on the Windows platform but it isn't used anywhere.
>
>
> Bug URL: https://bugs.openjdk.java.net/browse/JDK-8047714
>
> Webrev: http://cr.openjdk.java.net/~fparain/8047714/webrev.00/
>
>
> Thanks,
>
> Fred
>


More information about the hotspot-runtime-dev mailing list