http://d.puremagic.com/issues/show_bug.cgi?id=4307
Jonathan M Davis <jmdavisp...@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jmdavisp...@gmx.com --- Comment #1 from Jonathan M Davis <jmdavisp...@gmx.com> 2010-11-01 01:13:14 PDT --- I don't know if this is the same problem or not, but the most threads that I seem to be able to create in a program is 505 or 506. import std.concurrency; import std.stdio; void main() { int currThreads = 0; enum maxThreads = 6; size_t totalThreads = 0; auto recProc = (Tid tid) { writeln(++totalThreads); }; for(size_t i = 0; i < 1_000; ++i) { if(currThreads < maxThreads) receiveTimeout(1, recProc); else receive(recProc); spawn(&threadFunc, thisTid); } while(currThreads > 0) receive(recProc); } void threadFunc(Tid parentTid) { send(parentTid, thisTid); } prints out to either 505 or 506 and then throws an exception: core.thread.ThreadException: Error creating thread ---------------- ./d(void core.thread.Thread.start()) [0x80902b0] ./d(_D3std11concurrency34__T6_spawnTS3std11concurrency3TidZ6_spawnFbPFS3std11concurrency3TidZvS3std11concurrency3TidZS3std11concurrency3Tid+0x7f) [0x808c3c7] ./d(_D3std11concurrency33__T5spawnTS3std11concurrency3TidZ5spawnFPFS3std11concurrency3TidZvS3std11concurrency3TidZS3std11concurrency3Tid+0x10) [0x808c344] ./d(_Dmain+0x6b) [0x8087d0f] ./d(extern (C) int rt.dmain2.main(int, char**)) [0x8091a56] ./d(extern (C) int rt.dmain2.main(int, char**)) [0x80919b0] ./d(extern (C) int rt.dmain2.main(int, char**)) [0x8091a9a] ./d(extern (C) int rt.dmain2.main(int, char**)) [0x80919b0] ./d(main+0x96) [0x8091956] /usr/lib32/libc.so.6(__libc_start_main+0xe6) [0xf756ec76] ./d() [0x8087bf1] My best guess is that the threads aren't really terminating, so the OS is running out of threads. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------