On Saturday, 5 March 2016 at 14:18:31 UTC, Atila Neves wrote:
With a small number of threads, things work as intended in the code below. But with 1000, on my machine it either crashes or throws an exception:


import std.stdio;
import std.parallelism;
import std.range;


void main() {
    stdout = File("/dev/null", "w");
    foreach(t; 1000.iota.parallel) {
        writeln("Oops");
    }
}



I get, depending on the run, "Bad file descriptor", "Attempting to write to a closed file", or segfaults. What am I doing wrong?

Atila

Could this be a bug in phobos/compiler?

Reply via email to