Skip to main content

Module parallel

Module parallel 

Source
Expand description

This module defines parallel operations that are implemented in one way for the serial compiler, and another way the parallel compiler.

Re-exportsΒ§

use std::any::Any; πŸ”’
use std::ops::Index; πŸ”’
use std::ops::Range; πŸ”’
use std::panic::AssertUnwindSafe; πŸ”’
use std::panic::catch_unwind; πŸ”’
use std::panic::resume_unwind; πŸ”’
use parking_lot::Mutex; πŸ”’
use crate::FatalErrorMarker; πŸ”’
use crate::sync::DynSend; πŸ”’
use crate::sync::DynSync; πŸ”’
use crate::sync::FromDyn; πŸ”’
use crate::sync::IntoDynSyncSend; πŸ”’
use crate::sync::mode; πŸ”’

StructsΒ§

ParallelGuard
A guard used to hold panics that occur during a parallel section to later by unwound. This is used for the parallel compiler to prevent fatal errors from non-deterministically hiding errors by ensuring that everything in the section has completed executing before continuing with unwinding. It’s also used for the non-parallel code to ensure error message output match the parallel compiler for testing purposes.

ConstantsΒ§

MAX_GROUP_COUNT πŸ”’

TraitsΒ§

HasLength

FunctionsΒ§

broadcast
par_fns
Runs the functions in parallel.
par_for_each_in
par_for_each_slice
par_join
par_map
par_range
Executes the given action op with each index from range range in parallel if the parallel frontend is enabled, otherwise executes them sequentially. Action is executed with each index under parallel guard in both scenarios so if one of them panics all others will be executed anyway.
par_range_internal πŸ”’
par_slice_mut πŸ”’
parallel_guard
This gives access to a fresh parallel guard in the closure and will unwind any panics caught in it after the closure returns.
serial_join πŸ”’
spawn
try_par_for_each_in
This runs for_each in parallel for each iterator item. If one or more of the for_each calls returns Err, the function will also return Err. The error returned will be non-deterministic, but this is expected to be used with ErrorGuaranteed which are all equivalent.

Trait AliasesΒ§

Dss
ParSlice