Crates.io | yash-executor |
lib.rs | yash-executor |
version | 1.0.0 |
source | src |
created_at | 2024-09-28 15:48:01.055781 |
updated_at | 2024-09-28 15:48:01.055781 |
description | single-threaded concurrent task executor |
homepage | |
repository | https://github.com/magicant/yash-rs |
max_upload_size | |
id | 1390192 |
size | 58,035 |
yash-executor
is a Rust library that provides a simple executor for running
futures. It is designed to be used in single-threaded applications where you
want to run futures concurrently, but you don't need to run them on multiple
threads.
This crate is free of locks and atomic operations at the cost of unsafe spawning. Wakers used in this crate are thread-unsafe and not guarded by locks or atomics, so you must ensure that wakers are not shared between threads.
MIT or Apache 2.0, at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The futures-executor
crate's LocalPool
is similar but rejects reentrant
calls to run
, etc. as it depends on thread-local states. The yash-executor
crate allows creating and running multiple executors that work independently, so
users can have more fine-grained control over how concurrent tasks are run.
The async-executor
crate provides LocalExecutor
which is a wrapper around
the thread-safe Executor
and depends on locks for synchronization.
The yash-executor
crate is lock-free at the cost of unsafe spawning.
The simple-async-local-executor
crate is similar to yash-executor
but
also provides event signaling. Its implementation is free of locks and atomics
but still safe because the Waker
is a dummy and the Executor
polls all
futures even if not awakened.