Parallel reads on std.container.array.Array
Arun Chandrasekaran
aruncxy at gmail.com
Sat Dec 9 06:29:50 UTC 2017
On Saturday, 9 December 2017 at 01:34:40 UTC, Arun Chandrasekaran
wrote:
> So I tried the same on Haswell processor with LDC 1.6.0 and it
> crashes
>
> ```
> === Starting D version ===
> Took 1 sec, 107 ms, and 383 μs to load 1000000 items. Gonna
> search in parallel...
> *** Error in `./dmain-ldc': double free or corruption
> (fasttop): 0x0000000000edc6e0 ***
> *** Error in `./dmain-ldc': double free or corruption
> (fasttop): 0x0000000000edc6e0 ***
> ```
Learnt (from David Nadlinger) that due to lifetime management of
transitory ranges, they can't be used for parallel reads.
Iterating by index has solved the problem.
However, accessing the items in Array results in value copy. Is
that expected? How can I fix this?
http://forum.dlang.org/post/cfhkszdbkaezprbzrnlc@forum.dlang.org
More information about the Digitalmars-d-learn
mailing list