On Fri, Jun 19, 2020 at 06:48:18AM +, Simen Kjærås via Digitalmars-d-learn
wrote:
[...]
> There's an example of exactly this in std.parallelism:
> https://dlang.org/phobos/std_parallelism.html#.TaskPool.workerIndex
>
> In short:
>
> Item[] targetArray = ...; // already contains data
>
On Thursday, 18 June 2020 at 14:43:54 UTC, H. S. Teoh wrote:
I have an array of input data that I'm looping over, and, based
on some condition, generate new items that are appended onto a
target array (which may already contain data). Since the
creation of new items is quite expensive, I'm thin
I have an array of input data that I'm looping over, and, based on some
condition, generate new items that are appended onto a target array
(which may already contain data). Since the creation of new items is
quite expensive, I'm thinking to parallelize it with parallel foreach.
To avoid data race