Skip to content

Implement a new algorithm to make this crate no_std #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
if: startsWith(matrix.rust, 'nightly')
run: cargo check -Z features=dev_dep
- run: cargo test
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: rustup target add thumbv7m-none-eabi
- run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps

msrv:
runs-on: ubuntu-latest
Expand Down
14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ categories = ["asynchronous", "concurrency"]
exclude = ["/.*"]

[dependencies]
parking = "2.0.0"
concurrent-queue = { git = "https://github.com/smol-rs/concurrent-queue.git", branch = "loom", default-features = false }
parking = { version = "2", optional = true }
portable-atomic = { version = "0.3", default-features = false, optional = true }

# Enables loom testing. This feature is permanently unstable and the API may
# change at any time.
[target.'cfg(loom)'.dependencies]
loom = { version = "0.5", optional = true }
concurrent-queue = { git = "https://github.com/smol-rs/concurrent-queue.git", branch = "loom", default-features = false, features = ["loom"] }

[features]
default = ["std"]
std = ["parking", "concurrent-queue/std"]

[dev-dependencies]
criterion = "0.3.4"
Expand Down
12 changes: 12 additions & 0 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ fn bench_events(c: &mut Criterion) {
}
});
});

c.bench_function("notify_single", |b| {
let ev = Event::new();

b.iter(|| {
for _ in 0..COUNT {
let handle = ev.listen();
ev.notify(1);
handle.wait();
}
});
});
}

criterion_group!(benches, bench_events);
Expand Down
Loading