Rayon, par_iter, IO bound, specifying # threads

  1. Does Rayon par_iter have a way to infer whether tasks are CPU bound or IO bound ?

  2. If no, is there a way to manually tell Rayon par_iter how many threads to use for IO bound tasks ?

Parrallel IO data processing fork-join thread::spawn or rayon or other? is a similar question that may be worth reading. My take away is that you should use Tokio for tasks doing lots of IO and that Rayon is unaware of IO: the thread doing IO in Rayon will simply block and that processor will be unused while blocking (edit: assuming a processor per Rayon thread).

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.