pub struct WorkerSlot<K, V> { /* private fields */ }Expand description
Per-worker exclusive slot holding a BatchBuf inside an UnsafeCell.
The WORKER_ID TLS invariant guarantees that only one thread ever accesses any given slot, eliminating the need for any synchronisation primitive on the insert hot-path (zero atomics, zero locks, pure memory write).
Implementations§
Source§impl<K, V> WorkerSlot<K, V>
impl<K, V> WorkerSlot<K, V>
Source§impl<K, V> WorkerSlot<K, V>
impl<K, V> WorkerSlot<K, V>
Sourcepub unsafe fn get_mut_unchecked(&self) -> &mut BatchBuf<K, V>
pub unsafe fn get_mut_unchecked(&self) -> &mut BatchBuf<K, V>
Provides exclusive access to the underlying buffer.
§Safety
The caller must guarantee that only one thread accesses this slot at a time. In DualCache-FF this is enforced by the WORKER_ID TLS invariant.
Trait Implementations§
Source§impl<K, V> Default for WorkerSlot<K, V>
impl<K, V> Default for WorkerSlot<K, V>
impl<K: Send, V: Send> Send for WorkerSlot<K, V>
impl<K: Send + Sync, V: Send + Sync> Sync for WorkerSlot<K, V>
Auto Trait Implementations§
impl<K, V> !Freeze for WorkerSlot<K, V>
impl<K, V> !RefUnwindSafe for WorkerSlot<K, V>
impl<K, V> Unpin for WorkerSlot<K, V>
impl<K, V> UnsafeUnpin for WorkerSlot<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
impl<K, V> UnwindSafe for WorkerSlot<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more