On Thursday, 20 September 2018 at 05:34:42 UTC, Chris Katko wrote:
All I want to do is loop from 0 to [constant] with a for or foreach, and have it split up across however many cores I have.

You're looking at std.parallelism.TaskPool, especially the amap and reduce functions. Should do pretty much exactly what you're asking.

auto taskpool = new TaskPool();
taskpool.reduce!((a, b) => a + b)(iota(1_000_000_000_000L));

Reply via email to