pub struct WorkStealQueue<T: Marshal + Copy + 'static> { /* private fields */ }Expand description
Single-owner, multi-thief work-stealing queue, backed by the
SharedDeque<T> family. The owner pushes
via push; thieves drain via steal.
The dispatcher’s variant pick for the caller’s workload shape is
reported via variant; the generic-T: Marshal
surface uses Chase-Lev as the backing because it is the only
variant generic over arbitrary T: Marshal. Byte-slice
workloads (e.g. scheduler PassSlot) can ride the higher-
throughput KHL/KHPD/LOH/URD variants directly via the
DequeDispatcher API.
Implementations§
Source§impl<T: Marshal + Copy + 'static> WorkStealQueue<T>
impl<T: Marshal + Copy + 'static> WorkStealQueue<T>
Sourcepub fn create(
path: impl AsRef<Path>,
shape: MmfWorkloadShape,
capacity: usize,
) -> Result<Self, ApiError>
pub fn create( path: impl AsRef<Path>, shape: MmfWorkloadShape, capacity: usize, ) -> Result<Self, ApiError>
Create the queue at path with the given workload shape.
capacity is rounded up to next pow2.
Sourcepub fn open_as_thief(path: impl AsRef<Path>) -> Result<Self, ApiError>
pub fn open_as_thief(path: impl AsRef<Path>) -> Result<Self, ApiError>
Open an existing queue at path as a thief.
Sourcepub fn variant(&self) -> DequeVariant
pub fn variant(&self) -> DequeVariant
The variant the dispatcher picked for this workload.
Auto Trait Implementations§
impl<T> Freeze for WorkStealQueue<T>
impl<T> RefUnwindSafe for WorkStealQueue<T>
impl<T> Send for WorkStealQueue<T>
impl<T> Sync for WorkStealQueue<T>
impl<T> Unpin for WorkStealQueue<T>
impl<T> UnsafeUnpin for WorkStealQueue<T>
impl<T> UnwindSafe for WorkStealQueue<T>
Blanket Implementations§
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