RFR: Update running count of ForkJoinPool when thread pinned [v3]

Ron Pressler ron.pressler at oracle.com
Tue Jan 4 13:30:15 UTC 2022



On 23 Dec 2021, at 02:48, Miao Zheng <duke at openjdk.java.net<mailto:duke at openjdk.java.net>> wrote:

Thanks for your response.

Eliminating pin is absolutely better. Except supporting Java monitors, I still have a question that how to support native frame or what the plan is with native frame?

I have another question that we should think a bit of pin is tolerable or not?If a bit of pin is tolerable, then maybe we should make pin work better with scheduler.


Pinning while there’s a native frame on the virtual thread’s stack will likely remain forever (AFAIK, all other implementation of user-mode threads in other languages have the same behaviour). Pinning is only a problem if it’s long and happens very frequently. Short-lived and/or infrequent pinning should not have a significant impact. For example, during class loading, there are native frames on the stack that pin the virtual thread, but class-loading is relatively infrequent, so that’s OK.

— Ron




More information about the loom-dev mailing list