pub struct StealingQueue<TTask: Prioritized<Kind = Priority>> { /* private fields */ }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.
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> 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