I just tested something like this:
boost::thread workerThread1(boost::bind(&Class::Function, this, ...);
boost::thread workerThread2(boost::bind(&Cla
Can you not just create a list (or similar) of threads and then just create them and add to the list.
Something like the following (which is likely more pseudo code that anything :-) )
list threads;
for
{
boost::thread* name = new boost::thread(...);
threads.push_back(name);
}
As mentioned in another answer you can use smart pointers which would be better and you mentioned you have a defined number of threads so an array/vector would be a better choice but as I said the code above isn't perfect anyway