This lock-free container is suitable in situations where you perform a lot of reads to a
but only rarely modify that
From a logic point of view, it is more or less the equivalent of an
RwLock, except that:
- It works in
- Reading the
Talways takes the same time and will never wait for a lock to be released.
- Writing the
Tis done in a compare-and-swap way, and updates might have to be performed multiple times.
See the documentation of the
let val = wrrm::Wrrm::from(5); assert_eq!(*val.access(), 5); val.modify_with(|v| *v += 1); assert_eq!(*val.access(), 6);
Shared access to the content of the
Pending modification to the content of the