Struct work_queue::LocalQueue
source · pub struct LocalQueue<T> { /* private fields */ }
Expand description
One of the local queues in a Queue
.
You can create this using Queue::local_queues
.
Implementations§
source§impl<T> LocalQueue<T>
impl<T> LocalQueue<T>
sourcepub fn push(&mut self, item: T)
pub fn push(&mut self, item: T)
Push an item to the local queue. If the local queue is full, it will move half of its items to the global queue.
sourcepub fn push_yield(&mut self, item: T)
pub fn push_yield(&mut self, item: T)
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.
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Pop an item from the local queue, or steal from the global and sibling queues if it is empty.
Trait Implementations§
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§
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