lampepfl / gears

A strawman for a low-level async library in Scala 3.
https://lampepfl.github.io/gears/
Apache License 2.0
239 stars 23 forks source link

Use a scheduler instead of ForkJoinPool on JVM? #77

Open He-Pin opened 3 months ago

He-Pin commented 3 months ago

Motivation: As in PR https://github.com/com-lihaoyi/cask/pull/125/commits/17dbf69d43bb4027c14caf2c7fc1140b9b5a9f50 I found it's possible to run the virtual thread on another thread pool instead of the default scheduler.

I think that maybe a little lightweight in some cases if the task never forks. what do you think, I would like to contribute this if you like.

natsukagami commented 3 months ago

Yes, I think this is definitely useful! Perhaps custom thread pools can be implemented as an instance of Scheduler

He-Pin commented 3 months ago

Great, that's the whole point, I will prepare it after work today:)