From: Tim Laplaca (tlaplaca_at_[hidden])
Date: 2004-11-24 09:21:07
I switched the parameter-passing to the bind method, e.g.
thrds.create_thread( boost::bind( updatethread, threadid, "123456789" )
with no difference.
I did find that the same code that "aborts" under Linux seems to run ok
[mailto:boost-bounces_at_[hidden]] On Behalf Of Tim Laplaca
Sent: Tuesday, November 23, 2004 3:32 PM
Subject: [boost] Thread: Why is my prog aborting after 283 or so
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));
Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk