pub struct OverflowTaskQueue<E: Copy, const N: usize = TASKQUEUE_SIZE> { /* private fields */ }Expand description
OverflowTaskQueue is a TaskQueue that also includes an overflow stack for elements that do not fit in the TaskQueue.
This class hides two methods from super classes:
push() - push onto the task queue or, if that fails, onto the overflow stack is_empty() - return true if both the TaskQueue and overflow stack are empty
Note that size() is not hidden–it returns the number of elements in the TaskQueue, and does not include the size of the overflow stack. This simplifies replacement of GenericTaskQueues with OverflowTaskQueues.
Implementations§
Source§impl<E: Copy, const N: usize> OverflowTaskQueue<E, N>
impl<E: Copy, const N: usize> OverflowTaskQueue<E, N>
pub fn new() -> Self
pub fn taskqueue_empty(&self) -> bool
pub fn overflow_empty(&self) -> bool
pub fn overflow_stack(&self) -> &mut Stack<E>
pub fn try_push_to_taskqueue(&mut self, elem: E) -> bool
pub fn pop_overflow(&mut self) -> Option<E>
Methods from Deref<Target = GenericTaskQueue<E, N>>§
pub const INVALID_QUEUE_ID: usize = 18_446_744_073_709_551_615usize
pub fn set_last_stolen_queue_id(&mut self, id: usize)
pub fn last_stolen_queue_id(&self) -> usize
pub fn is_last_stolen_queue_id_valid(&self) -> bool
pub fn invalidate_last_queue_id(&mut self)
Methods from Deref<Target = TaskQueueSuper<N>>§
pub const MOD_N_MASK: usize
pub fn age_top_relaxed(&self) -> Idx
pub fn cmpxchg_age(&self, old_age: Age, new_age: Age) -> Age
pub fn set_age_relaxed(&self, new_age: Age)
pub fn release_set_bottom(&self, new_bottom: usize)
pub fn set_bottom_relaxed(&self, new_bottom: usize)
pub fn bottom_acquire(&self) -> usize
pub fn bottom_relaxed(&self) -> usize
pub fn assert_empty(&self)
pub fn is_empty(&self) -> bool
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Return an estimate of the number of elements in the queue. Treats pop_local/pop_global race that underflows as empty.
pub fn set_empty(&self)
pub fn age_relaxed(&self) -> Age
Trait Implementations§
Source§impl<E: Copy, const N: usize> TaskQueue for OverflowTaskQueue<E, N>
impl<E: Copy, const N: usize> TaskQueue for OverflowTaskQueue<E, N>
type E = E
fn is_empty(&self) -> bool
fn size(&self) -> usize
fn push(&mut self, elem: E) -> bool
fn pop_global(&self) -> PopResult<E>
fn pop_local(&self, threshold: usize) -> Option<E>
fn invalidate_last_queue_id(&mut self)
fn last_stolen_queue_id(&self) -> usize
fn next_random_queue_id(&mut self) -> i32
fn set_last_stolen_queue_id(&mut self, id: usize)
Auto Trait Implementations§
impl<E, const N: usize = TASKQUEUE_SIZE> !Freeze for OverflowTaskQueue<E, N>
impl<E, const N: usize = TASKQUEUE_SIZE> !RefUnwindSafe for OverflowTaskQueue<E, N>
impl<E, const N: usize = TASKQUEUE_SIZE> !Send for OverflowTaskQueue<E, N>
impl<E, const N: usize = TASKQUEUE_SIZE> !Sync for OverflowTaskQueue<E, N>
impl<E, const N: usize> Unpin for OverflowTaskQueue<E, N>
impl<E, const N: usize> UnwindSafe for OverflowTaskQueue<E, N>where
E: 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