pub struct StealingQueue<TTask: Prioritized<Kind = Priority>> {
Share: Arc<Share<TTask>>,
}Expand description
A generic, priority-aware, work-stealing queue.
This is the public-facing entry point for submitting tasks. It is generic
over any task type TTask that implements the Prioritized trait.
Fields§
A shared, thread-safe pointer to the queue’s shared components.
Implementations§
Source§impl<TTask: Prioritized<Kind = Priority>> StealingQueue<TTask>
impl<TTask: Prioritized<Kind = Priority>> StealingQueue<TTask>
Sourcepub fn Create(Count: usize) -> (Self, Vec<Context<TTask>>)
pub fn Create(Count: usize) -> (Self, Vec<Context<TTask>>)
Creates a complete work-stealing queue system.
This function initializes all the necessary queues, both shared and thread-local, for a given number of workers.
§Returns
A tuple containing:
- The public-facing
StealingQueuefor submitting new tasks. - A
VecofContextobjects, one for each worker thread to own.
Auto Trait Implementations§
impl<TTask> Freeze for StealingQueue<TTask>
impl<TTask> RefUnwindSafe for StealingQueue<TTask>where
TTask: RefUnwindSafe,
impl<TTask> Send for StealingQueue<TTask>where
TTask: Send,
impl<TTask> Sync for StealingQueue<TTask>where
TTask: Send,
impl<TTask> Unpin for StealingQueue<TTask>
impl<TTask> UnsafeUnpin for StealingQueue<TTask>
impl<TTask> UnwindSafe for StealingQueue<TTask>where
TTask: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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