#thread #thread-safe #data #sharing #shared #share #fifo

real-time

Safely share data with a real-time thread

3 releases (breaking)

0.5.0 Mar 28, 2024
0.4.0 Mar 17, 2024
0.3.0 Feb 18, 2024
0.2.0 Feb 11, 2024
0.1.0 Oct 22, 2023

#475 in Concurrency

Download history 2/week @ 2024-02-08 121/week @ 2024-02-15 70/week @ 2024-02-22 121/week @ 2024-02-29 130/week @ 2024-03-14 16/week @ 2024-03-21 168/week @ 2024-03-28 10/week @ 2024-04-04

200 downloads per month
Used in cmajor

MIT/Apache

33KB
825 lines

real-time ⏱️

Build Crates.io Docs.rs

Safely share data with a real-time thread.

Overview

This crate provides some tools for sharing data with a real-time thread:

Shared Values

Type wrappers that can be used to share values between a real-time thread and another thread, in a way that is real-time safe.

They use the same algorithms as RealtimeObject from FAbian's Realtime Box o' Tricks, that was presented at Meeting C++ 2019.

  • RealtimeReader, for reading from a shared value on a real-time thread.
  • RealtimeWriter, for writing to a shared value on a real-time thread.

FIFOs

  • fifo, a lock-free single-producer, single-consumer FIFO that is optimised for a real-time consumer.

Usage

Add this to your Cargo.toml:

[dependencies]
real-time = "0.5"

License

Licensed under either of

at your option.

Contribution

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.

Dependencies

~0–27MB
~354K SLoC