OverflowTaskQueue

Struct OverflowTaskQueue 

Source
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>

Source

pub fn new() -> Self

Source

pub fn taskqueue_empty(&self) -> bool

Source

pub fn overflow_empty(&self) -> bool

Source

pub fn overflow_stack(&self) -> &mut Stack<E>

Source

pub fn try_push_to_taskqueue(&mut self, elem: E) -> bool

Source

pub fn pop_overflow(&mut self) -> Option<E>

Methods from Deref<Target = GenericTaskQueue<E, N>>§

Source

pub const INVALID_QUEUE_ID: usize = 18_446_744_073_709_551_615usize

Source

pub fn set_last_stolen_queue_id(&mut self, id: usize)

Source

pub fn last_stolen_queue_id(&self) -> usize

Source

pub fn is_last_stolen_queue_id_valid(&self) -> bool

Source

pub fn invalidate_last_queue_id(&mut self)

Methods from Deref<Target = TaskQueueSuper<N>>§

Source

pub const MOD_N_MASK: usize

Source

pub fn age_top_relaxed(&self) -> Idx

Source

pub fn cmpxchg_age(&self, old_age: Age, new_age: Age) -> Age

Source

pub fn set_age_relaxed(&self, new_age: Age)

Source

pub fn release_set_bottom(&self, new_bottom: usize)

Source

pub fn set_bottom_relaxed(&self, new_bottom: usize)

Source

pub fn bottom_acquire(&self) -> usize

Source

pub fn bottom_relaxed(&self) -> usize

Source

pub fn assert_empty(&self)

Source

pub fn is_empty(&self) -> bool

Source

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.

Source

pub fn set_empty(&self)

Source

pub fn age_relaxed(&self) -> Age

Trait Implementations§

Source§

impl<E: Copy, const N: usize> Deref for OverflowTaskQueue<E, N>

Source§

type Target = GenericTaskQueue<E, N>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<E: Copy, const N: usize> DerefMut for OverflowTaskQueue<E, N>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<E: Copy, const N: usize> TaskQueue for OverflowTaskQueue<E, N>

Source§

type E = E

Source§

fn is_empty(&self) -> bool

Source§

fn size(&self) -> usize

Source§

fn push(&mut self, elem: E) -> bool

Source§

fn pop_global(&self) -> PopResult<E>

Source§

fn pop_local(&self, threshold: usize) -> Option<E>

Source§

fn invalidate_last_queue_id(&mut self)

Source§

fn last_stolen_queue_id(&self) -> usize

Source§

fn next_random_queue_id(&mut self) -> i32

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V