Virtual threads vs JMM + public API for replacing scheduler

Krzysztof Ślusarski pasqal at gmail.com
Tue Nov 22 09:37:23 UTC 2022


Hi, currently in performance world you can see a lot of investment in
thread-per-core architecture. I tried to use loom virtual threads to
create a POC with such a design, and I see two missing parts:
- I cannot find any information about how virtual threads are
connected with Java Memory Model. If I have multiple virtual threads
that are running on the same carrier thread, can I treat it as
single-threaded execution in terms of JMM?
- There is no public API for switching the scheduler (I believe there
was one in the past), can we ask for bringing it back?

With those two it would be trivial to write TPC application in java.
You create multiple single threaded executors, use thread affinity to
pin the threads to specific cores and then use virtual threads on the
top of that.

Regards,
KŚ


More information about the loom-dev mailing list