Skip to main content

lc_team_run

Function lc_team_run 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn lc_team_run( nstages: usize, chunks: *const usize, fn_: Option<extern "C" fn(*mut c_void, usize, usize, usize)>, ctx: *mut c_void, ) -> c_int
Expand description

Run nstages stages in one parallel region on the pool selected by lc_set_threads, the caller one of the workers (see team). Stage s is chunks[s] calls of fn_(ctx, s, chunk, worker), in any order and on any worker; every chunk of a stage returns before any chunk of the next starts. worker is fixed for one worker thread during the call and below lc_team_width, so it can index per-worker scratch. No worker that has not started holds up a stage or the return.

ยงSafety

chunks is readable for nstages sizes. fn_ does not unwind and may be called from any thread of the pool until the call returns.