mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
threadpool: introduce a global task queue (#798)
This commit is contained in:
committed by
Toby Lawrence
parent
201b6ce53a
commit
fdf4aba621
@@ -161,7 +161,10 @@ impl<'a> tokio_executor::Executor for &'a Sender {
|
||||
// Create a new task for the future
|
||||
let task = Arc::new(Task::new(future));
|
||||
|
||||
self.pool.submit_to_random(task, &self.pool);
|
||||
// Call `submit_external()` in order to place the task into the global
|
||||
// queue. This way all workers have equal chance of running this task,
|
||||
// which means IO handles will be assigned to reactors more evenly.
|
||||
self.pool.submit_external(task, &self.pool);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user