Cooperative vs preemtive scheduling of virtual theads

Andrey Lomakin lomakin.andrey at
Sat Jun 6 15:16:08 UTC 2020

I have started to develop a prototype of the project which was based on
earlier versions on quasar and now on early builds of Loom JDK. According
to the paper which describes the state of the Loom project even though now
virtual threads use only cooperative scheduling, it is considered to use
forced preemption during some conditions.
My problem is that cooperative preemption is much more useful for me. My
project based on the approach, that different components of the project do
not share data, and each component instance handles requests inside of
dedicated single thread executor, which schedules virtual threads. Knowing
when exactly you need to care about concurrent execution of the virtual
threads allows to create faster code and use data structures and algorithms
which you will not be able to use in other cases.
So my question is, according to your perception of the current state of the
project, how is it possible that forced preemption will be introduced as
default behaviour? And will it be possible to switch it off by providing
options during the start of the JVM? Sure, that situation could be changed
during the development of the project. But I would like to hear your

Best regards,
Andrey Lomakin.

More information about the loom-dev mailing list