Import std.concurrent.parallel
ParallelReduce
function
Public Function ParallelReduce<T: Sendable>(items: T[], combine: Sendable Func(T, T): T): T?
The items combined with combine, which takes two values and gives one, or Null for no items.
They're cut into parts, each combined left to right on the pool at once, and then the parts'
values left to right, so combine must give the same however its calls are grouped, as + and
Max do, though it needn't let its values swap places.
Examples
Expect(ParallelReduce([1, 2, 3, 4], Function(a: Int, b: Int) => a + b) == 10)Report an issue with this page or with FutureBlitz on GitHub.