#[repr(align(64))]pub struct Shard(_);
Expand description
A single shard.
This is one copy of place where the library keeps tracks of generation locks. It consists of a pair of counters and allows double-buffering readers (therefore, even if there’s a never-ending stream of readers coming in, writer will get through eventually).
To avoid contention and sharing of the counters between readers, we don’t have one pair of generation counters, but several. The reader picks one shard and uses that, while the writer looks through all of them. This is still not perfect (two threads may choose the same ID), but it helps.
Each LockStorage
must provide a (non-empty) array of these.