Dear maintainers,
May I bother you with a question?
I did some research recently
https://jacum.medium.com/running-cats-effect-on-virtual-threads-of-jdk21-7a68ea97fd65
TLDR:
The current way of dealing with occasional blocking contexts in Cats Effect is sub-optimal, when compared to native fiber scheduling implemented on JDK21.
Of course - JDK21 is still fresh, and may not (yet) available for all and every JVM workload, but it is clearly very efficient. It is also next LTS after JDK 17, and likely will be most widely used one in a year or two.
I wonder what is your take on the future of the runtime on JDK21?
Is the whole runtime going to be replaced to thread-per-runnable?
Or just maybe rewrite blockOn() method
|
override def blockOn[T](thunk: => T)(implicit permission: CanAwait): T = { |
to run that 'thunk' on Executors.newVirtualThreadPerTaskExecutor() and leave the rest of non-blocking executor to use the same Thread API?
Dear maintainers,
May I bother you with a question?
I did some research recently
https://jacum.medium.com/running-cats-effect-on-virtual-threads-of-jdk21-7a68ea97fd65
TLDR:
The current way of dealing with occasional blocking contexts in Cats Effect is sub-optimal, when compared to native fiber scheduling implemented on JDK21.
Of course - JDK21 is still fresh, and may not (yet) available for all and every JVM workload, but it is clearly very efficient. It is also next LTS after JDK 17, and likely will be most widely used one in a year or two.
I wonder what is your take on the future of the runtime on JDK21?
Is the whole runtime going to be replaced to thread-per-runnable?
Or just maybe rewrite blockOn() method
cats-effect/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala
Line 817 in 623178c
to run that 'thunk' on Executors.newVirtualThreadPerTaskExecutor() and leave the rest of non-blocking executor to use the same Thread API?