typelevel / cats-effect

The pure asynchronous runtime for Scala
https://typelevel.org/cats-effect/
Apache License 2.0
2.03k stars 521 forks source link

More efficient monitoring of fibers on virtual threads #4014

Open armanbilge opened 9 months ago

armanbilge commented 9 months ago

Spinning out of https://github.com/typelevel/cats-effect/issues/3929#issuecomment-1896382827.

We fixed the memory leak, but monitoring fibers on virtual threads still has a single point of contention.

djspiewak commented 8 months ago

In general this is going to be a difficult space for us. There are probably a ton of places where we assume the absolute number of threads is small while the number of fibers is large. I agree we should try to fix this issue, but we're probably going to be playing whack-a-mole a bit.

Overall, we should probably consider where along the spectrum from "ignoring virtual threads" to "we have a dedicated runtime and fiber implementation when we detect virtual thread support" we want to fall.