Parallel processing and further use of output
Zoidberg via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Sep 26 08:24:33 PDT 2015
On Saturday, 26 September 2015 at 13:09:54 UTC, Meta wrote:
> On Saturday, 26 September 2015 at 12:33:45 UTC, anonymous wrote:
>> foreach (f; parallel(iota(1, 1000000+1)))
>> {
>> synchronized i += f;
>> }
>
> Is this valid syntax? I've never seen synchronized used like
> this before.
Atomic worked perfectly and reasonably fast. "Synchronized" may
work as well, but I had to abort the execution prior to finishing
because it seemed horribly slow.
More information about the Digitalmars-d-learn
mailing list