Scheduler API Feedback

dreamlike_ocean lei dreamlike.vertx at gmail.com
Sat Oct 4 13:19:10 UTC 2025


Hello @loom-dev <loom-dev at openjdk.org>,

I have been enjoying the new POLLER_PER_CARRIER design in the Loom repo and
I really like the direction it is going.
While building on top of the latest code, I noticed a couple of issues and
would like to ask for clarification.

   1.

   When calling Thread.startVirtualThread, the new virtual thread does not
   inherit the scheduler of the calling virtual thread, but instead uses
   DEFAULT_SCHEDULER. What is the reasoning behind this design? Could there
   be a mechanism to allow implicit inheritance? This would be very helpful
   for custom schedulers based on the per-core model.
   2.

   The method Thread.VirtualThreadScheduler::current is very helpful, but
   it seems not quite enough. Since Loom already provides the read-only
   builtin.externalView, could we also have a method like
   Thread.VirtualThreadScheduler::scheduler(Thread)? This would make it
   easier to build better schedulers. For example, I could combine
   Thread.currentThread with Thread.VirtualThreadScheduler.scheduler to
   decide whether to push a task into a local task queue rather than the
   eventLoop’s MPSC queue.

Thank you for your time and help.
Best regards,
dreamlike li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251004/3093cb42/attachment.htm>


More information about the loom-dev mailing list