-
Enhancement
-
Resolution: Fixed
-
P3
-
15
-
b11
The OopStorage API was introduced to allow decoupling of the runtime and the GC in this area, so we should look at converting the _threadObj to use OopStorage.
There are a couple of complexities to consider here:
1. The _threadObj oop is also accessed directly by the JIT code as an intrinsic implementation for java.lang.Thread:;currentThread(). That method has always been "hot" with regard to performance so we need to ensure performance is maintained.
2. The time that we would want to clear the _threadObj storage is after the JavaThread is no longer on any secondary ThreadsLists (just before, or as part of JavaThread destructor execution). However at that time it is not allowed for the terminating thread to interact with OopStorage. Consequently we would have to hand off to another thread (e.g. the ServiceThread) to do the release. A synchronous handoff is relatively simple but might introduce a serialization bottleneck for thread termination. An asynchronous handoff requires a queue and appropriate locking strategies that then have to interact with the Service_lock correctly. This could also have performance implications.
Note that since
- blocks
-
JDK-8248407 Move Universe roots into OopStorage
- Resolved
- relates to
-
JDK-8251336 OopHandle release can not be called in a safepoint
- Resolved
-
JDK-8297168 Provide a bulk OopHandle release mechanism with the ServiceThread
- Resolved
-
JDK-8252466 assert(is_virtual(jt)) failed: invariant in JfrJavaThread::virtual_thread(JavaThread const*)+0x5c
- Resolved
-
JDK-8240588 _threadObj cannot be used on an exiting JavaThread.
- Resolved
-
JDK-8252627 Make it safe for JFR thread to read threadObj
- Resolved
-
JDK-8285301 C2: assert(!requires_atomic_access) failed: can't ensure atomicity
- Resolved
-
JDK-8314859 JNI AttachCurrentThread/DetachCurrentThread experiences performance regression on JDK17
- Closed