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
I have a Vec of tasks that vary widely in duration. To maximize utilization of the whole thread pool, I want the tasks at lower indices in the Vec to start soonest, so that the last long-running task runs in parallel with some short-running tasks rather than becoming a bottleneck at the end. How do I ensure this? Right now I'm using
let planned_tasks: Vec<CloneableLazyTask<()>>
= large_tasks.into_iter().chain(small_tasks.into_iter()).collect();
planned_tasks.into_par_iter().for_each(move |task| {
let name = task.name.to_owned();
task.into_result()
.unwrap_or_else(|err| panic!("Error running task {}: {:?}", name, err));
});
However, the ordering within large_tasks also matters.
The text was updated successfully, but these errors were encountered:
Maybe scope_fifo and its associated spawn_fifo would suit you better? Then you would not need planned_tasks at all, just create a scope and then spawn the tasks directly from their original sources.
I have a Vec of tasks that vary widely in duration. To maximize utilization of the whole thread pool, I want the tasks at lower indices in the Vec to start soonest, so that the last long-running task runs in parallel with some short-running tasks rather than becoming a bottleneck at the end. How do I ensure this? Right now I'm using
However, the ordering within large_tasks also matters.
The text was updated successfully, but these errors were encountered: