Module concread::ebrcell

source ·
Expand description

EbrCell - A concurrently readable cell with Ebr

An EbrCell can be used in place of a RwLock. Readers are guaranteed that the data will not change during the lifetime of the read. Readers do not block writers, and writers do not block readers. Writers are serialised same as the write in a RwLock.

This is the Ebr collected implementation. Ebr is the crossbeam-epoch based reclaim system for async memory garbage collection. Ebr is faster than Arc, but long transactions can cause the memory usage to grow very quickly before a garbage reclaim. This is a space time trade, where you gain performance at the expense of delaying garbage collection. Holding Ebr reads for too long may impact garbage collection of other epoch structures or crossbeam library components. If you need accurate memory reclaim, use the Arc (CowCell) implementation.

Structs

A concurrently readable cell.
A read transaction. This stores a reference to the data from the main EbrCell, and guarantees it is alive for the duration of the read.
An EbrCell Write Transaction handle.