Skip to main content

ForkJoin

Struct ForkJoin 

Source
pub struct ForkJoin {
    pub value_domain_size: u64,
    pub wstate: Vec<WorkerState>,
    pub wvalue: Vec<u64>,
    pub phase: ForkJoinPhase,
    pub output_ready: bool,
    pub output_snapshot: Vec<u64>,
}
Expand description

Fork-join execution owner.

Fields§

§value_domain_size: u64

Exclusive upper bound of worker values.

§wstate: Vec<WorkerState>

Worker lifecycle states by worker index.

§wvalue: Vec<u64>

Current values by worker index.

§phase: ForkJoinPhase

Global fork-join phase.

§output_ready: bool

Whether a stable output snapshot has been produced.

§output_snapshot: Vec<u64>

Stable joined output values.

Implementations§

Source§

impl ForkJoin

Source

pub fn new( workers: usize, value_domain_size: u64, initial_value: u64, ) -> ForkJoin

Construct a fork-phase execution with ready workers.

Source

pub fn start_worker(&mut self, worker: usize) -> bool

Start one ready worker, returning false when the transition is disabled.

Source

pub fn complete_worker(&mut self, worker: usize, value: u64) -> bool

Complete one running worker with an in-domain value.

Source

pub fn barrier(&mut self) -> bool

Commit the join barrier after every worker completes.

Source

pub fn produce_output(&mut self) -> bool

Produce the stable output snapshot from joined worker values.

Source

pub fn done_stuttering(&mut self) -> bool

Execute the terminal stutter when output production is complete.

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.