[][src]Struct bastion_executor::run_queue::Stealer

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

A stealer handle of a worker queue.

Stealers can be shared among threads.

Task schedulers typically have a single worker queue per worker thread.

Methods

impl<T> Stealer<T>[src]

pub fn is_empty(&self) -> bool[src]

Returns true if the queue is empty.

pub fn run_queue_size(&self) -> usize[src]

Returns back the run queue size for the current worker through stealer

pub fn steal(&self) -> Steal<T>[src]

Steals a task from the queue.

pub fn steal_batch(&self, dest: &Worker<T>) -> Steal<()>[src]

Steals a batch of tasks and pushes them into another worker.

How many tasks exactly will be stolen is not specified. That said, this method will try to steal around half of the tasks in the queue, but also not more than some constant limit.

pub fn steal_batch_and_pop(&self, dest: &Worker<T>) -> Steal<T>[src]

Steals a batch of tasks, pushes them into another worker, and pops a task from that worker.

How many tasks exactly will be stolen is not specified. That said, this method will try to steal around half of the tasks in the queue, but also not more than some constant limit.

pub fn steal_batch_and_pop_with_amount(
    &self,
    dest: &Worker<T>,
    amount: usize
) -> Steal<T>
[src]

Steals a batch of tasks and amend to the given worker's run queue with the specified amount. If requested amount is above the threshold of time-ahead it defaults to time-ahead amount.

Trait Implementations

impl<T: Send> Send for Stealer<T>[src]

impl<T: Send> Sync for Stealer<T>[src]

impl<T> Clone for Stealer<T>[src]

impl<T> Debug for Stealer<T>[src]

Auto Trait Implementations

impl<T> Unpin for Stealer<T>

impl<T> UnwindSafe for Stealer<T> where
    T: RefUnwindSafe

impl<T> RefUnwindSafe for Stealer<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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