Skip to content

Commit d263ceb

Browse files
authored
Merge pull request #9 from asder8215/thread_pin
Thread pin
2 parents 32e5247 + 87b07c8 commit d263ceb

24 files changed

+4768
-2521
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
build_and_test:
14-
name: lf-shardedringbuf
14+
name: sharded_ringbuf
1515
runs-on: ubuntu-latest
1616

1717
steps:
@@ -40,6 +40,3 @@ jobs:
4040

4141
- name: Install nightly toolchain
4242
run: rustup toolchain install nightly
43-
44-
- name: Run benchmark
45-
run: cargo +nightly bench | tee output.txt

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
# Change for shardedringbuf:
2+
3+
## In v0.1.0:
4+
* A new policy has been made called `CFT` (or Completely Fair Tasks). See `src/task_local_spawn.rs` for more details.
5+
* Spawn functions have been refactored to specifically call on enqueue and dequeue functions
6+
of `ShardedRingBuf<T>` (as a result, the async enqueue and dequeue functions for the buffer is private)
7+
* Updated doc comments on spawn function and Shard Policies and various other places.
8+
* No new benchmarking details have been updated as of now due (though benchmarking code
9+
is being modularized currently).
10+
111
# Change Log for lf-shardedringbuf:
212

313
## In v4.1.0:
4-
* A new policy has been made called `CFT` (or Completely Fair Tasks). See `src/task_local_spawn.rs` for more details. Note that the shard policies might be refactored in the future (alongside all the other policies) to be as part of one of `LFShardedRingBuf<T>` functions.
5-
* Updated doc comments on spawn function and Shard Policies and various other places.
6-
* No new benchmarking details have been updated as of now due.
14+
* Crate has been deprecated and moved to `sharded_ringbuf` due to high number of version changes and the crate name is a misnomer because it technically uses locks with the key feature of this buffer being that it has shards.
15+
* There have been other changes here before it was marked deprecated like `CFT` (Completely Fair Tasks) being implemented, which is why the major version change has been updated here instead of patch version.
716

817
## In v3.1.0:
918
* Metadata in `LFShardedRingBuf<T>` is once again refactored such that everything uses atomic primitives (i.e. `Box<[UnsafeCell<MaybeUninit<T>>]>` -> `Box<[AtomicPtr<MaybeUninit<T>>]>`). It implement `Send` and `Sync` by default now!

Cargo.lock

Lines changed: 149 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,72 @@
11
[package]
2-
name = "lf-shardedringbuf"
3-
version = "3.1.0"
2+
name = "sharded_ringbuf"
3+
version = "0.1.0"
44
edition = "2024"
55
rust-version="1.87.0"
66
description = """
7-
An async, lock-free, sharded, cache-aware SPSC/MPSC/MPMC ring buffer in Rust.
7+
A Tokio async, sharded SPSC/MPSC/MPMC ring buffer in Rust.
88
"""
99
authors= ["Mahdi Ali-Raihan mma2268@columbia.edu"]
1010
license = "MIT"
1111
keywords = ["sharding", "async", "ring-buffer", "mpmc", "spsc"]
12-
categories = ["concurrency"]
12+
categories = ["concurrency", "async"]
1313
readme = "README.md"
14-
repository = "https://github.com/asder8215/lf-shardedringbuf"
15-
homepage = "https://github.com/asder8215/lf-shardedringbuf"
16-
documentation = "https://docs.rs/lf-shardedringbuf/latest/lf_shardedringbuf/"
14+
repository = "https://github.com/asder8215/sharded_ringbuf"
15+
homepage = "https://github.com/asder8215/sharded_ringbuf"
16+
documentation = "https://docs.rs/sharded_ringbuf/latest/sharded_ringbuf/"
1717

1818
[dependencies]
1919
crossbeam-utils = "^0.8.21"
2020
fastrand = "^2.3.0"
2121
futures-util = "0.3.31"
22-
tokio = {version = "^1.45.1", features = ["rt"] }
22+
tokio = {version = "^1.45.1", features = ["rt", "sync"] }
2323

2424
[dev-dependencies]
2525
criterion = {version = "^0.6.0", features =["async_tokio"] }
2626
tokio = {version = "^1.45.1", features = ["sync", "macros", "rt-multi-thread"] }
2727
kanal = "^0.1.1"
28+
async-channel = "2.5.0"
29+
crossbeam = "0.8"
30+
flume = {version="0.11", features= ["async"] }
2831

2932
[[bench]]
30-
name = "rb_benchmarks"
33+
name = "srb_shiftby"
34+
harness = false
35+
36+
[[bench]]
37+
name = "srb_sweep"
38+
harness = false
39+
40+
[[bench]]
41+
name = "srb_randomsweep"
42+
harness = false
43+
44+
[[bench]]
45+
name = "srb_cft"
46+
harness = false
47+
48+
[[bench]]
49+
name = "srb_pin"
50+
harness = false
51+
52+
[[bench]]
53+
name = "flume"
54+
harness = false
55+
56+
[[bench]]
57+
name = "tokio"
58+
harness = false
59+
60+
[[bench]]
61+
name = "crossbeam"
62+
harness = false
63+
64+
[[bench]]
65+
name = "crossfire"
66+
harness = false
67+
68+
[[bench]]
69+
name = "kanal_async"
3170
harness = false
3271

3372
[profile.dev]

0 commit comments

Comments
 (0)