6 releases
0.3.0 | Mar 12, 2024 |
---|---|
0.2.2 | May 3, 2023 |
0.2.1 | Apr 30, 2023 |
0.1.1 | Apr 8, 2023 |
0.1.0 | Mar 31, 2023 |
#331 in Asynchronous
32 downloads per month
Used in bab
135KB
2.5K
SLoC
async-unsync - Single Threaded Async Channels
A Rust library for asynchronous but unsynchronized (single-threaded)
communication primitives, primarily channels and semaphores with an API that is
designed to be as similar to tokio::sync
as possible.
Most async
executors use multi-threaded runtimes and consequently, most
synchronization primitives are implemented to be thread-safe, thus incurring
the associated synchronization overhead.
By restricting their use to single-threaded/thread-local tasks only, the
synchronization overhead can be entirely avoided, resulting in up to 10x faster
channel operations.
Usage
To use this crate, add the following to your Cargo.toml
:
[dependencies]
async-unsync = "0.2.2"
Cargo Features
std
: Enabled by default, includesalloc
and addsError
implementations for error typesalloc
: Enabled by default, required forbounded
andunbounded
channels
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your choice.
Dependencies
~0–5.5MB
~19K SLoC