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.

Reply via email to