Some questions about Virtual Thread for JDK21
Weibing Xiao
weibing.xiao at oracle.com
Fri Nov 22 16:51:49 UTC 2024
Hello Everyone,
I am researching virtual thread implementation in JDK21. I have some questions list below. Hope to get some answers and hints from our community.
* VT will be mounted to PT. It is M:N model. Do we have recommended M (number of VT) comparing with N (number of PT, typically it is equal to the number of cores of CPU)?
* If VT is created, but never mounted to PT (never run), how do we find this situation?
* The default value for the parallelism is the number of CPU cores. Setting the parallelism to 256 (max allowed by JDK), is there any difference for the performance if number of CPU cores is small, ex, 10?
* The default scheduler is set for VT. How can a developer to create their own scheduler?
* The code can use ExecutorService or Thread builder to start VT. Is there any subtle difference?
* Beside current existing debug tool and skill , is there any other tool/way to debug the failure of VT?
* The VT is saved as stack chunk objects. Per the document, if VT reaches half the region size, it might throw StackOverflowError. Typically, what will cause the size of VT growing?
* When GC starts to work on chunk objects, how will it work? Any performance issue?
* If new feature is implemented by VT and required backporting to lower version of JDK, What are the recommendation and suggestion for sustaining engineer to help this work done correctly and error free?
* Mount vs Unmount: what does JVM do? If this action fails, what will happen?
* notifyJvmMount vs notifyJvmUnmount, what does JVM react to this call?
* Is there any full stack trace from starting to the end when running VT?
* How to duplicate “VirtualThreadSubmitFailedEvent”? if failed, what does it look like?
* When the deadlock happens, is it possible to see how many PTs are available?
Appreciate your help and time greatly.
Weibing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20241122/f810687e/attachment.htm>
More information about the loom-dev
mailing list