#rcu #lockless #atomic

no-std rcu_cell

a lockless rcu cell implementation

12 releases

Uses old Rust 2015

0.1.11 Mar 9, 2023
0.1.10 Apr 7, 2021
0.1.8 Jun 23, 2019
0.1.7 Apr 2, 2019
0.1.2 Sep 28, 2018

⚠️ Issues reported

#171 in Concurrency

Download history 38/week @ 2023-06-05 34/week @ 2023-06-12 78/week @ 2023-06-19 53/week @ 2023-06-26 82/week @ 2023-07-03 39/week @ 2023-07-10 62/week @ 2023-07-17 59/week @ 2023-07-24 30/week @ 2023-07-31 53/week @ 2023-08-07 72/week @ 2023-08-14 42/week @ 2023-08-21 46/week @ 2023-08-28 64/week @ 2023-09-04 42/week @ 2023-09-11 44/week @ 2023-09-18

208 downloads per month
Used in 7 crates (via ate)

LGPL-3.0

18KB
428 lines

Build Status Current Crates.io Version Document

RcuCell

A lockless rcu cell implementation that can be used safely in multithread context.

Features

  • The write operation would not block the read operation.
  • The write operation would "block" the write operation.
  • The RcuCell could contain no data

Usage

   fn single_thread() {
        let t = RcuCell::new(Some(10));
        let x = t.read();
        let y = t.read();
        t.try_lock().unwrap().update(None);
        let z = t.read();
        let a = z.clone();
        drop(t); // t can be dropped before reader
        assert_eq!(x.map(|v| *v), Some(10));
        assert_eq!(y.map(|v| *v), Some(10));
        assert_eq!(z.map(|v| *v), None);
        assert_eq!(a.map(|v| *v), None);
    }

No runtime deps