-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use actual thread local queues instead of using a RwLock
Currently, runner local queues rely on a RwLock<Vec<Arc<ConcurrentQueue>>>> to store the queues instead of using actual thread-local storage. This adds thread_local as a dependency, but this should allow the executor to work steal without needing to hold a lock, as well as allow tasks to schedule onto the local queue directly, where possible, instead of always relying on the global injector queue. Fixes #62 Co-authored-by: John Nunley <[email protected]>
- Loading branch information
Showing
4 changed files
with
92 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ name = "async-executor" | |
version = "1.8.0" | ||
authors = ["Stjepan Glavina <[email protected]>"] | ||
edition = "2021" | ||
rust-version = "1.60" | ||
rust-version = "1.61" | ||
description = "Async executor" | ||
license = "Apache-2.0 OR MIT" | ||
repository = "https://github.com/smol-rs/async-executor" | ||
|
@@ -17,10 +17,12 @@ exclude = ["/.*"] | |
[dependencies] | ||
async-lock = "3.0.0" | ||
async-task = "4.4.0" | ||
atomic-waker = "1.0" | ||
concurrent-queue = "2.0.0" | ||
fastrand = "2.0.0" | ||
futures-lite = { version = "2.0.0", default-features = false } | ||
slab = "0.4.4" | ||
thread_local = "1.1" | ||
|
||
[target.'cfg(target_family = "wasm")'.dependencies] | ||
futures-lite = { version = "2.0.0", default-features = false, features = ["std"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
use std::future::Future; | ||
use std::thread::available_parallelism; | ||
|
||
use async_executor::Executor; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters