Crate pinboard

Source
Expand description

A Pinboard is a shared, mutable, eventually consistent, lock-free data-structure. This allows multiple threads to communicate in a decoupled way by publishing data to the pinboard which other threads can then read in an eventually consistent way.

This is not a silver bullet though, there are various limitations of Pinboard that trade off the nice behaviour described above.

  • Eventual consistency:
    • Writes from one thread are not guaranteed to be seen by reads from another thread
    • Writes from one thread can overwrite writes from another thread
  • No in-place mutation:
    • The only write primitive completely overwrites the data on the Pinboard

Structsยง

GuardedRef
Stores a pointer to a T, alongside a guard which protects the data from garbage collection.
NonEmptyPinboard
An wrapper around a Pinboard which provides the guarantee it is never empty.
Pinboard
An instance of a Pinboard, holds a shared, mutable, eventually-consistent reference to a T.