Struct work_queue::LocalQueue[][src]

pub struct LocalQueue<T> { /* fields omitted */ }

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

impl<T: Debug> Debug for LocalQueue<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for LocalQueue<T>

impl<T> Send for LocalQueue<T> where
    T: Send

impl<T> Sync for LocalQueue<T> where
    T: Send + Sync

impl<T> Unpin for LocalQueue<T> where
    T: Unpin

impl<T> !UnwindSafe for LocalQueue<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.