Module node_replication::rwlock[][src]

Expand description

The distributed readers-writer lock used by the replica.

This module is only public since it needs to be exposed to the benchmarking code. For clients there is no need to rely on this directly, as the RwLock is embedded inside the Replica.

Testing with loom

We’re not using loom in this module because we use UnsafeCell and loom’s UnsafeCell exposes a different API. Luckily, loom provides it’s own RwLock implementation which (with some modifications, see loom_rwlock.rs) we can use in the replica code.

Structs

A read-guard that can be used to read the underlying data structure. Writes on the data structure will be blocked as long as one of these is lying around.

A scalable reader-writer lock.

A write-guard that can be used to write to the underlying data structure. All reads will be blocked until this is dropped.