On 4/4/23 5:24 AM, Salih Dincer wrote:
Is it necessary to enclose the code in `foreach()`? I invite Ali to tell me! Please explain why parallel isn't running.
parallel is a shortcut to `TaskPool.parallel`, which is indeed a foreach-only construct, it does not return a range.
I think what you want is `TaskPool.map`: ```d // untested, just looking at the taskPool.map!(/* your map function here */) (s.iota(len)).writeln; ``` Can't use pipelining with it, because it is a member function. https://dlang.org/phobos/std_parallelism.html#.TaskPool.map -Steve