Why is there an option to enable virtual threads in ThreadPoolTaskExecutor? #34758
Labels
for: stackoverflow
A question that's better suited to stackoverflow.com
status: invalid
An issue that we don't feel is valid
Hello,
From what I understand, virtual threads are structurally designed in a way that doesn't require a thread pool.
However, despite this, ThreadPoolTaskExecutor has added an option to enable virtual threads.
I had assumed that when virtual threads are enabled, settings like core pool size, max pool size, and queue capacity wouldn't be used.
But it seems that even when virtual threads are enabled, those configurations are still being utilized in some way.
Looking into the code, it appears that a virtual thread can be injected into the ThreadFactory of Java’s ThreadPoolExecutor.
I'm curious about the intention behind this. Was it designed to allow virtual threads to be used like a thread pool?
Thank you.
The text was updated successfully, but these errors were encountered: