Unsafe.park/unpark, j.u.c.LockSupport and Thread

Paul Sandoz paul.sandoz at oracle.com
Tue Feb 10 14:51:58 UTC 2015

On Feb 10, 2015, at 3:39 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
>> Adding native methods to 166 classes will introduce another form of dependency on the platform that i would prefer to avoid.
> Right. And I suspect that the separate distributable of 166, outside of the Java Platform, would not want to have to carry a separate platform specific native library.


>>> But I don't see any reason why we couldn't move the implementation from unsafe.cpp to jvm.cpp and invoke via a native method implementation of LockSupport. It would still be just as "unsafe" of course.
>> Can you think of any reasons, beyond that of "don't touch the core classes", why we cannot copy this functionality over to java.lang.{*, Thread} ?
> Would you be thinking of making the changes public, i.e. new standard API on java.lang.Thread ?

Yes, j.l.Thread seems like the ideal location :-)


More information about the hotspot-runtime-dev mailing list