Module thread

Source
Expand description

Utilities relating to threading and parallelism.

Structs§

Ptr
Unsafe Send and Sync pointer type.

Functions§

for_each_raw
Executes the tasks by passing the values in 0..n_tasks to op, possibly in parallel, while splitting the amount of parallelism between the tasks.
join_raw
Executes the two operations, possibly in parallel, while splitting the amount of parallelism between the two.
par_split_indices
Returns the start and length of a subsegment of 0..n, split between chunk_count consumers, for the consumer at index idx.
parallelism_degree
The amount of threads that should ideally execute an operation with the given parallelism.