java.lang.ThreadBuilders and java.lang.ThreadBuilders.newVirtualThread() are not public
Rick Hendricksen
Rick.Hendricksen at vanderlande.com
Tue Aug 20 15:32:30 UTC 2024
Hi,
We have implemented a Discrete Event Simulator, and we want to use virtual threads to write our business logic (that uses the DES) in a more readable way. This business logic has a lot of blocking operations, so it seems to be a good fit for virtual threads. However, we must ensure that all those virtual threads run on the same carrier thread, because the simulation has to be deterministic. We also often run multiple separate simulations in parallel, so it’s important that virtual threads end up on the right scheduler. This means we need to use our own scheduler.
To achieve this we call newVirtualThread with reflection (and we have to add --add-opens), and that works. But we'd like to have a solution that continues working in future java versions, so we'd like this use case to be officially supported. Can this method become public?
Best regards,
Rick Hendricksen
________________________________
** Disclaimer **
This e-mail, including any attachments, may include proprietary and confidential information of Vanderlande and may only be read by the person or those persons to whom it is addressed.
This document is forwarded to you in such a form (e-mail) that Vanderlande cannot guarantee the completeness and/or correctness of its contents and information.
If you have received this e-mail message in error, please notify us immediately.
Please also delete this document from your computer.
This document may not be reproduced, copied, distributed, published, modified, or furnished to third parties, without the prior written consent of Vanderlande.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240820/c349cb96/attachment-0001.htm>
More information about the loom-dev
mailing list