-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Motivation
There are scenarios where blocking tasks (sync IO, heavy cpu computation, etc) may cause some async code to block. Tokio relies on cooperative multitasking, so there are bugs if tokio async tasks never yield. A particularly relevant one is that it may cause other tasks that are in the queue for the same thread to never execute. This behaviour is visible in the following tokio issue tokio-rs/tokio/issues/4730
Proposal
- First: allow the actors to be moved to their own thread in tokio, which can be done through the Runtime::spawn_blocking method.
- Second: add a requirement to our own custom runtime that doesn't exhibit this behaviour. Either by creating new task always on their own dedicated thread or by having the pool of tasks be global.
Considerations
Before the second proposal, we should investigate if other runtimes exist and what model they use for thread management.
Metadata
Metadata
Assignees
Labels
No labels