3 ms·
Hello, Author here :) I did a bad job explaining what I consider to be a worker pool (i.e some kind of class that encourages statefulness and mutable data). My
by sylvain_kerkour 5y ago
Hello,
Author here :)
I did a bad job explaining what I consider to be a worker pool (i.e some kind of class that encourages statefulness and mutable data). My bad, I'll fix that. It's just a question of abstraction.
> what are good practices in Rust when you have different workloads running alongside each other?
Very good question! I will try to add my recommendations at the end of the post tonight.
For the moment, I would say the best practice for this scenario is to use both rayon and a Stream.
The thing is to be careful about how many CPU cores you allocate for the CPU bound tasks and how many for tokio's internal thread pool (it will depend on the workloads).