Skip to content

Tokio for compute bound tasks #5068

Answered by Noah-Kennedy
tbetcke asked this question in General
Discussion options

You must be logged in to vote

It certainly can work for this, it's just not what it is designed for. Tokio is designed around the assumption that tasks are going to be generally nonblocking and will yield to the runtime frequently. This assumption is baked into a number of things, such as our parking routine and our workstealing implementation.

I'd generally suggest sticking with Rayon for compute-bound workloads. If you have a workload that is bound by both IO and compute, then I would recommend mixing Tokio with Rayon.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by tbetcke
Comment options

You must be logged in to vote
1 reply
@Noah-Kennedy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants