
3 Aug
2010
3 Aug
'10
6:01 p.m.
On 8/3/2010 4:10 PM, Albert Schueller wrote:
int main(int argc, char* argv[]) { int i; int num_thrds = 3; boost::thread *thrd[4];
for(i=0;i<num_thrds;i++) { thrd[i] = new boost::thread(count(i+1)); thrd[i]->join();
^^^^ that's your problem. join won't return until the thread finishes you need 3 loops. first loop, call new, just like you were. then for i=0;i<num_thrds;i++) { thrd[i]->join (); } then, run your delete loop.