Struct work_queue::LocalQueue [−][src]
One of the local queues in a Queue.
You can create this using Queue::local_queues.
Implementations
impl<T> LocalQueue<T>[src]
pub fn push(&mut self, item: T)[src]
Push an item to the local queue. If the local queue is full, it will move half of its items to the global queue.
pub fn push_yield(&mut self, item: T)[src]
Push an item to the local queue, skipping the LIFO slot. This can be used to give other tasks a chance to run. Otherwise, there’s a risk that one task will completely take over a thread in a push-pop cycle due to the LIFO slot.
pub fn pop(&mut self) -> Option<T>[src]
Pop an item from the local queue, or steal from the global and sibling queues if it is empty.
#[must_use]pub fn searchers(&self) -> usize[src]
Get the number of threads that are currently searching for work inside pop.
If this number is too high, you may wish to avoid calling pop to reduce
contention.
#[must_use]pub fn global(&self) -> &Queue<T>[src]
Get the global queue that is associated with this local queue.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for LocalQueue<T>
impl<T> Send for LocalQueue<T> where
T: Send,
T: Send,
impl<T> Sync for LocalQueue<T> where
T: Send + Sync,
T: Send + Sync,
impl<T> Unpin for LocalQueue<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for LocalQueue<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,