You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of IO APIs are blocking, for example readline().
As such they should not be scheduled on the Weave threadpool as it would prevent scheduling of Work and then block the whole runtime.
Instead a dedicated threadpool for block tasks should be introduced with a spawnBlocking call.
We are not concerned with load balancing or potentially distributed scheduling so a bag of threads waiting for work on a condition variable is enough.
The number of threads in the pool can be adjusted dynamically with a timeout on the condition variable and if thread is not scheduled before the timeout it is removed from the pool.
This introduces a start delay if threads are not used often but it allows handling say 10 terminals + readlines and scale down when threads are unneeded.
The text was updated successfully, but these errors were encountered:
From #132,
A lot of IO APIs are blocking, for example
readline()
.As such they should not be scheduled on the Weave threadpool as it would prevent scheduling of Work and then block the whole runtime.
Instead a dedicated threadpool for block tasks should be introduced with a
spawnBlocking
call.We are not concerned with load balancing or potentially distributed scheduling so a bag of threads waiting for work on a condition variable is enough.
The number of threads in the pool can be adjusted dynamically with a timeout on the condition variable and if thread is not scheduled before the timeout it is removed from the pool.
This introduces a start delay if threads are not used often but it allows handling say 10 terminals + readlines and scale down when threads are unneeded.
The text was updated successfully, but these errors were encountered: