Import std.concurrent.parallel
ParallelForEach
function
Public Function ParallelForEach<T: Sendable>(items: T[], action: Sendable Func(T))
Calls action with each item, on the pool at once, in no order.
Examples
Global total = Atomic<Int>(0)
Function AddUp(n: Int)
total.Add(n)
End Function
ParallelForEach([1, 2, 3, 4], AddUp)
Expect(total.Load() == 10)Report an issue with this page or with FutureBlitz on GitHub.