pub fn ranges(
n: usize,
unit: usize,
run: &(dyn Fn(Range<usize>) -> bool + Sync),
) -> boolExpand description
Runs run on disjoint ranges covering 0..n, and gives whether every call said true. Every range runs, even after a failure. Each range contains whole units of unit items, except that the last unit may be shorter. A call of at most one unit, or one whose calls run on this thread, runs whole on this thread. A longer call times its first unit on this thread, then cuts the rest into as many pieces as that estimate gives PIECE_TIME each, at most four for each of this thread’s threads. It runs them as [pieces] does, or runs the rest in one call on this thread where that gives fewer than two pieces. This non-generic, out-of-line scheduler keeps Rayon’s machinery out of its callers. An empty call runs 0..0 once. Panics if unit is zero.