From: Tim Laplaca (tlaplaca_at_[hidden])
Date: 2004-11-23 15:31:54
I wrote a prog that spawns threads (RED HAT Fedora Core 2), and after
spawning 283 or so threads, it stops running and 'Aborted' is printed.
It doesn't matter if I spawn them one after each other, or only 10 at a
time, or if the threads only last 1 second or if they all stick around
until the 283rd thread is spawned. Every combination I've tried results
in the prog aborting at about the 283rd thread spawn.
Does this sound familiar to anybody?
Is there something my thread must do to properly shut itself down? Does
it need to call some kind of procedure to announce it is going away for
proper cleanup? I couldn't see anything in the examples like that.
And is there documentation explaining the examples? I failed to find
My thread procedure:
void updatethread(void* inparams)
int local_threadid = tparam->param1;
std::string DID = tparam->param2;
std::cout << " Thread:" << local_threadid << " running. "
"UPDATE for " << DID << std::endl;
// wait some secs (just for debug, remove when real work is
xt.sec += 2;
std::cout << " Thread:" << local_threadid << " Exiting. " <<
MAIN calls it with this:
pt = thrds.create_thread(thread_adapter(&updatethread, (void*)&tparam));
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk