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: u64Exclusive upper bound of worker values.
wstate: Vec<WorkerState>Worker lifecycle states by worker index.
wvalue: Vec<u64>Current values by worker index.
phase: ForkJoinPhaseGlobal fork-join phase.
output_ready: boolWhether a stable output snapshot has been produced.
output_snapshot: Vec<u64>Stable joined output values.
Implementations§
Source§impl ForkJoin
impl ForkJoin
Sourcepub fn new(
workers: usize,
value_domain_size: u64,
initial_value: u64,
) -> ForkJoin
pub fn new( workers: usize, value_domain_size: u64, initial_value: u64, ) -> ForkJoin
Construct a fork-phase execution with ready workers.
Sourcepub fn start_worker(&mut self, worker: usize) -> bool
pub fn start_worker(&mut self, worker: usize) -> bool
Start one ready worker, returning false when the transition is disabled.
Sourcepub fn complete_worker(&mut self, worker: usize, value: u64) -> bool
pub fn complete_worker(&mut self, worker: usize, value: u64) -> bool
Complete one running worker with an in-domain value.
Sourcepub fn produce_output(&mut self) -> bool
pub fn produce_output(&mut self) -> bool
Produce the stable output snapshot from joined worker values.
Sourcepub fn done_stuttering(&mut self) -> bool
pub fn done_stuttering(&mut self) -> bool
Execute the terminal stutter when output production is complete.
Auto Trait Implementations§
impl Freeze for ForkJoin
impl RefUnwindSafe for ForkJoin
impl Send for ForkJoin
impl Sync for ForkJoin
impl Unpin for ForkJoin
impl UnsafeUnpin for ForkJoin
impl UnwindSafe for ForkJoin
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