Boost C++ Libraries: Ticket #324: Boost::thread under Linux crashes after 200 to 400 threads https://svn.boost.org/trac10/ticket/324 <pre class="wiki">Reproduced on both version 1_31 and 1_32 of Boost. Reproduced on Mandrake Linux 10.0 and Fedora Core 2. NOT reproducable on Windows XP (Vis C++ 7.1). Programs generating threads with boost.thread abort after a few hundred threads. I do not mean concurrent threads; this has been reproduced with a program that never has more than one or two threads active at any one time. Attached to this bug report is very short program I wrote to demonstrate this problem. The program generates a thread every second, and each thread only lasts a second. There is never more than 1 or 2 threads active at any time. On Mandrake 10.0 the program aborts/crashes after 256 threads. On Fedora Core 2 it aborts after about 400 threads. The same program built with Vis C++ 7.1 on Win XP never seems to crash; it generated tens of thousands of threads before I manually ended it. Also attached is the Makefile to build the program with g++. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/324 Trac 1.4.3 tlaplaca Mon, 29 Nov 2004 19:00:09 GMT <link>https://svn.boost.org/trac10/ticket/324#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/324#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=1139403 Note: To reproduce the problem quickly, change the time the threads wait before ending to 0, and also the time the main loop waits between spawning threads to 0 as well. Otherwise, it will take one second per thread (which is useful to verify the problem isn't having all the threads open at once). </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>cepstein</dc:creator> <pubDate>Mon, 29 Nov 2004 20:08:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/324#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/324#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=36183 Not a bug. Call pthread_join to reap child thread's stack and exit code. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>tlaplaca</dc:creator> <pubDate>Mon, 29 Nov 2004 22:41:19 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/324#comment:3 https://svn.boost.org/trac10/ticket/324#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=1139403 cepstein is correct, I redesigned it so that main() joins the threads as they complete, and it has spawned over a million threads so far with no problem. Closed. </pre> Ticket