Skip to content
Merged
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
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ jobs:
- name: Check clippy lints
run: cargo clippy --workspace --all-targets -- -D warnings

- name: Set up cargo-binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install cargo-machete
uses: taiki-e/install-action@cargo-machete

- name: Look for unused dependencies with cargo-machete
run: |
cargo binstall -y cargo-machete
cargo machete
run: cargo machete

- name: Check semver
# Not guaranteed to run on nightly, so we use the separate job below
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
_No unreleased changes in the pipeline at the moment_


## [8.1.0] - 2025-02-02

### Added

- Add `Input::input_buffer_publisher()` method to provide an RAII-based
alternative to the low-level `input_buffer()`/`publish()` interface. Thanks
@crop2000 !

### Changed

- Rename `Input::input_buffer()` to `Input::input_buffer_mut()`, keeping a
deprecated alias for now, and do the same for `Output::output_buffer()`. This
is the start of a gradual deprecation process whose end goal is to eventually
follow the standard Rust accessor naming convention (`input_buffer(&self) ->
&T`, `input_buffer_mut(&mut self) -> &mut T`, same thing on the output side).


## [8.0.0] - 2024-06-21

### Added

- Add `Output::peek_output_buffer()` method to get read-only access to the
output buffer from a shared reference to self. Thanks @tk70!
output buffer from a shared reference to self. Thanks @tk70 !

### Changed

Expand Down Expand Up @@ -303,7 +320,8 @@ _No unreleased changes in the pipeline at the moment_



[Unreleased]: https://github.com/HadrienG2/triple-buffer/compare/v8.0.0...HEAD
[Unreleased]: https://github.com/HadrienG2/triple-buffer/compare/v8.1.0...HEAD
[8.1.0]: https://github.com/HadrienG2/triple-buffer/compare/v8.0.0...v8.1.0
[8.0.0]: https://github.com/HadrienG2/triple-buffer/compare/v7.0.0...v8.0.0
[7.0.0]: https://github.com/HadrienG2/triple-buffer/compare/v6.2.0...v7.0.0
[6.2.0]: https://github.com/HadrienG2/triple-buffer/compare/v6.1.0...v6.2.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "triple_buffer"
# - Roll an annotated git tag
# - Add a github release
#
version = "8.0.0"
version = "8.1.0"
authors = ["Hadrien G. <[email protected]>"]
description = "An implementation of triple buffering, useful for sharing frequently updated data between threads"
documentation = "https://docs.rs/triple_buffer/"
Expand Down
8 changes: 4 additions & 4 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub fn benchmark(c: &mut Criterion) {

{
let mut uncontended = c.benchmark_group("uncontended");
uncontended.bench_function("read output", |b| b.iter(|| *output.output_buffer()));
uncontended.bench_function("read output", |b| b.iter(|| *output.peek_output_buffer()));
uncontended.bench_function("clean update", |b| {
b.iter(|| {
output.update();
Expand All @@ -15,7 +15,7 @@ pub fn benchmark(c: &mut Criterion) {
uncontended.bench_function("clean receive", |b| b.iter(|| *output.read()));
uncontended.bench_function("write input", |b| {
b.iter(|| {
*input.input_buffer() = black_box(0);
*input.input_buffer_mut() = black_box(0);
})
});
uncontended.bench_function("publish", |b| {
Expand Down Expand Up @@ -56,7 +56,7 @@ pub fn benchmark(c: &mut Criterion) {
|| {
read_contended.bench_function("write input", |b| {
b.iter(|| {
*input.input_buffer() = black_box(0);
*input.input_buffer_mut() = black_box(0);
})
});
read_contended.bench_function("publish", |b| {
Expand All @@ -79,7 +79,7 @@ pub fn benchmark(c: &mut Criterion) {
|| input.write(black_box(0)),
|| {
write_contended
.bench_function("read output", |b| b.iter(|| *output.output_buffer()));
.bench_function("read output", |b| b.iter(|| *output.peek_output_buffer()));
write_contended.bench_function("update", |b| {
b.iter(|| {
output.update();
Expand Down
Loading