pub struct WorkStealingQueue<T> { /* private fields */ }Expand description
Work-stealing deque for load balancing
Implementations§
Source§impl<T> WorkStealingQueue<T>
impl<T> WorkStealingQueue<T>
Sourcepub fn push_local(&self, task: T) -> UtilsResult<()>
pub fn push_local(&self, task: T) -> UtilsResult<()>
Push a task to the local queue
Sourcepub fn push_global(&self, task: T) -> UtilsResult<()>
pub fn push_global(&self, task: T) -> UtilsResult<()>
Push a task to the global queue
Sourcepub fn pop_local(&self) -> UtilsResult<Option<T>>
pub fn pop_local(&self) -> UtilsResult<Option<T>>
Pop a task from the local queue
Sourcepub fn steal_work(&self) -> UtilsResult<Option<T>>
pub fn steal_work(&self) -> UtilsResult<Option<T>>
Steal work from other workers’ queues
Sourcepub fn get_task(&self) -> UtilsResult<Option<T>>
pub fn get_task(&self) -> UtilsResult<Option<T>>
Get the next task, trying local queue first, then stealing
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for WorkStealingQueue<T>
impl<T> RefUnwindSafe for WorkStealingQueue<T>
impl<T> Send for WorkStealingQueue<T>where
T: Send,
impl<T> Sync for WorkStealingQueue<T>where
T: Send,
impl<T> Unpin for WorkStealingQueue<T>
impl<T> UnwindSafe for WorkStealingQueue<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more