question about the semantics of unshared variables

aki via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 15 23:53:50 PDT 2015


I noticed just making many threads cause an error.
Are there any limit for the number of threads?

import std.concurrency;
import core.thread;
void fun() { Thread.sleep(5000.msecs); }
void testThread() {
	foreach(i; 0..2000) {
		spawn(&fun);
	}
}

core.thread.ThreadError at src\core\thread.d(2903): Error creating 
thread

Aki.



More information about the Digitalmars-d-learn mailing list