Replies: 1 comment 2 replies
-
virtual threads are still backed by platform threads, I really doubt that they offer a performance gain worthy of trying to patchwork these types of things, especially when most of the things using a thread pool for work which is pausable is code that is not written to utilise NIO or other mechanisms that actually support what vthreads intend to serve. Chat itself is not really going to scale much, and so I really doubt that using vthreads here would change much given how few chat threads are often actually in play, all that would change is that we'd add yet another layer of headaches to be weary of when providing support. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
At the moment the kernel uses OS threads, hence ThreadPools come from here
The current implementation (CachedThreadPool) allocates too many precious OS threads, to blocking I/O
This was the only solution to get good performance, but things changed with the move to jdk 21+
Describe the solution you'd like.
I tend to promote the concept of fibers in many places Paper: async chat, async scheduler (controversial) and many other places blocking I/O
This would not only simplify the code, but could seriously reduce overhead (on memory for example).
Describe alternatives you've considered.
I don't know what to write here, but I'm being asked to do it! The alternative (which is a bad solution in this case) is a coroutine boilerplate, but not as a suspend, but an Executor that doesn't park
Other
No response
Beta Was this translation helpful? Give feedback.
All reactions