#transactional-memory #stm #consistent #reclamation #built #top #crossbeam-epoch

crossbeam-stm

Software Transactional Memory system built on top of crossbeam-epoch

1 unstable release

Uses old Rust 2015

0.6.1 Aug 7, 2018
0.6.0 Aug 7, 2018
0.5.0 Aug 7, 2018
0.4.0 May 15, 2018
0.3.1 May 14, 2018

#8 in #reclamation

MIT/Apache

5KB
100 lines

Crossbeam-STM

Crossbeam-STM is a Software Transactional Memory implementation using crossbeam-epoch for memory reclamation. It is meant to be as fast and consistent as possible for load speed, at the expense of having inconsistent-timed and potentially very slow writes.

THIS PROJECT IS NOT READY FOR GENERAL USAGE.

Example

extern crate cb_stm_temp;

use cb_stm_temp::Stm;

// Create a new STM pointer with a Vec of numbers
let stm = Stm::new(vec![1,2,3,4]);

// Read from the STM
{
    let data = stm.load();
    println!("Current STM: {:?}", data);
}

// Update the STM pointer to add a new number
stm.update(|old| {
    let mut new = old.clone();
    new.push(5);
    new
});

// Read the new data
{
    let data = stm.load();
    println!("Current STM: {:?}", data);
}

Dependencies

~455KB