Skip to content

zakarumych/atomicell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atomicell crate

crates docs actions MIT/Apache loc

This crate provides AtomicCell type - a multi-threaded version of RefCell from standard library. AtomicCell uses atomics to track borrows and able to guarantee absence of mutable aliasing when multiple threads try to borrow concurrently.

Unlike mutexes and spin-locks AtomicCell does not have blocking calls. Borrows are either succeed immediately or fail.

There are fallible that return optional for borrowing calls - AtomicCell::try_borrow and AtomicCell::try_borrow_mut.

And panicking version - AtomicCell::borrow and AtomicCell::borrow_mut.