How do I create a real virtual thread pool?
Jianbin Chen
jianbin at apache.org
Fri Sep 26 09:36:48 UTC 2025
Hi everyone,
I hope you’re doing well. I have a question about a multi-tenant scenario.
I want to create a dedicated thread pool for each tenant, and these pools
will perform a lot of I/O (for example, database reads and writes). For
this reason I’d like to use virtual threads. However, because virtual
threads share platform threads under the hood, they cannot be fully
isolated from one another.
Consider this situation: a buggy task consumes CPU continuously. If the
host only has a single CPU core, that bug could cause the entire
application to fail. My thought is that if each tenant runs on its own
virtual-thread pool but without sharing platform threads between pools,
platform threads could still time-slice across tenants and thus reduce the
impact of a CPU-burning bug.
For a requirement like this, what would you recommend to achieve better
isolation and robustness? I would appreciate any guidance or suggested
approaches.
Thank you for your time and help.
Best Regards.
Jianbin Chen, github-id: funky-eyes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20250926/afd1eee2/attachment.htm>
More information about the loom-dev
mailing list