Expand description
Blocking execution primitives selected at compile time.
The default backend uses native threads, Crossbeam channels, and Rayon. With
both fuzz and --cfg dst, run callers inside Runtime::run: stackful Shuttle tasks execute
on one OS thread in fixed round-robin order. Only primitives from this crate may
block simulated tasks; native blocking or OS I/O is outside the simulation.
Re-exports§
pub use runtime::Runtime;
Modules§
- atomic
- Atomic types
- channel
- Cloneable MPMC channels for the selected backend.
- iter
- Rayon iterator APIs, evaluated serially under the deterministic scheduler.
- mpsc
- Multi-producer, single-consumer FIFO queue communication primitives.
- parking_
lot - Native non-poisoning locks, or their Shuttle equivalents under
fuzzplus--cfg dst. - pool
- Compute pools backed by Rayon normally and Shuttle logical threads under
fuzzplus--cfg dst. - rayon
- Rayon-compatible compute operations selected with the executor backend.
- runtime
- Explicit entry point for a blocking workload.
- thread
- Standard-compatible threads and borrowed scopes for the selected backend.
- time
- Monotonic and system time using native clocks or a virtual clock in simulation.
- mpmc
Experimental - Multi-producer, multi-consumer FIFO queue communication primitives.
- nonpoison
Experimental - Non-poisoning synchronous locks.
- oneshot
Experimental - A single-producer, single-consumer (oneshot) channel.
- poison
Experimental - Synchronization objects that employ poisoning.
Macros§
- thread_
local - Declare a new thread local storage key of type
std::thread::LocalKey.
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Barrier
- A barrier enables multiple threads to synchronize the beginning of some computation.
- Barrier
Wait Result - A
BarrierWaitResultis returned byBarrier::wait()when all threads in theBarrierhave rendezvoused. - Condvar
- A Condition Variable
- Lazy
Lock - A value which is initialized on the first access.
- Mutex
- A mutual exclusion primitive useful for protecting shared data
- Mutex
Guard - An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Once
- A low-level synchronization primitive for one-time global execution.
- Once
Lock - A synchronization primitive which can nominally be written to only once.
- Once
State - State yielded to
Once::call_once_force()’s closure parameter. The state can be used to query the poison status of theOnce. - Poison
Error - A type of error which can be returned whenever a lock is acquired.
- RwLock
- A reader-writer lock
- RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Guard - RAII structure used to release the exclusive write access of a lock when dropped.
- Sync
View SyncViewprovides mutable access, also referred to as exclusive access to the underlying value. However, it only permits immutable, or shared access to the underlying value when that value isSync.- Thread
Pool - Represents a user-created thread pool.
- Thread
Pool Builder - Used to create a new
ThreadPoolor to configure the global rayon thread pool. - Wait
Timeout Result - A type indicating whether a timed wait on a condition variable returned due to a time out or not.
- Weak
Weakis a version ofArcthat holds a non-owning reference to the managed allocation.- Mapped
Mutex Guard Experimental - An RAII mutex guard returned by
MutexGuard::map, which can point to a subfield of the protected data. When this structure is dropped (falls out of scope), the lock will be unlocked. - Mapped
RwLock Read Guard Experimental - RAII structure used to release the shared read access of a lock when dropped, which can point to a subfield of the protected data.
- Mapped
RwLock Write Guard Experimental - RAII structure used to release the exclusive write access of a lock when dropped, which can point to a subfield of the protected data.
- Reentrant
Lock Experimental - A re-entrant mutual exclusion lock
- Reentrant
Lock Guard Experimental - An RAII implementation of a “scoped lock” of a re-entrant lock. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Unique
Arc Experimental - A uniquely owned
Arc.
Enums§
- TryLock
Error - An enumeration of possible errors associated with a
TryLockResultwhich can occur while trying to acquire a lock, from thetry_lockmethod on aMutexor thetry_readandtry_writemethods on anRwLock.
Constants§
- IS_
SIMULATED - Whether these primitives require an active simulated runtime.
- ONCE_
INIT Deprecated - Initialization value for static
Oncevalues.
Type Aliases§
- Lock
Result - A type alias for the result of a lock method which can be poisoned.
- TryLock
Result - A type alias for the result of a nonblocking locking method.