java.lang.ThreadBuilders and java.lang.ThreadBuilders.newVirtualThread() are not public

Alan Bateman alan.bateman at oracle.com
Tue Aug 20 15:44:53 UTC 2024


On 20/08/2024 16:32, Rick Hendricksen wrote:
>
> 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.
>
Can the simulation be run with a single carrier thread 
(-Djdk.virtualThreadScheduler.maxPoolSize=1) ?

There are a number of explorations into using custom schedulers but 
impossible to say at this point if anything will be exposed.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240820/fb772a14/attachment.htm>


More information about the loom-dev mailing list