Crate sync42

Source
Expand description

§sync42

sync42 provides synchronization tools.

§Status

Active development. sync 42 is likely to expand to include new data structures. Existing data structures are maintenance-track.

§Scope

sync42 provides core types for synchronization. Any synchronization pattern general enough to be generalized is candidate for inclusion.

§Warts

  • The library is currently missing some critical data structures.
  • The documentation needs work.

§Documentation

The latest documentation is always available at docs.rs.

§Updating

  • 0.3.0 -> 0.4.0: Changes to StateHashTable and WaitList.
  • 0.2.0 -> 0.3.0: Added the StateHashTable. Backwards compatible for existing structures.

Modules§

background
Manage background-threads.
collector
A RCU-like quiescent state detector.
lru
A concurrent Least Recently Used cache that holds a limited number of entries, according to the size of each entry. The implementation is a concurrent, but not lock-free, structure that marries a map with a linked list.
monitor
Implementation of a monitor in classic Hoare-style.
registry
A global registry of static objects. Allows objects to belong to one or more registries.
spin_lock
An efficient FIFO spin lock. Threads will contend in much the same way as an MCU lock, relying on the caching system to shoot down the cache line when it gets written.
state_hash_table
StateHashTable solves the rendezvous problem.
wait_list
WaitList provides a collection for synchronizing threads. Internally, the collection owns MAX_CONCURRENCY positions of rendezvous called Waiter (private). You can call WaitList::link to allocate a waiter and return a WaitGuard. Holding a wait guard allows one to construct an iterator or random-accessor over all subsequent threads in the data structure. In this way, the head of the list can iterate the list, batching operations together, and then iterate the list again to distribute the batched work.
work_coalescing_queue
A work coalescing queue batches work to be done together, for purposes of performance.

Constants§

MAX_CONCURRENCY
The maximum concurrency expected by any type in sync42. Performance is allowed to degrade if there are more than this many concurrent threads accessing a structure.

Functions§

register_biometrics
Register all biometrics for the crate.