12 Oct
2006
12 Oct
'06
8:12 a.m.
Peter Dimov
That said, why do you even have to keep the boost::thread objects? There aren't many useful things that you could do with a boost::thread; if you run 24/7 you should be able to just spawn the threads "detached":
boost::thread( f );
without keeping them in a thread group.
Hi,
On Windows the ~thread() doesnot detach the thread. Hence, the below listed
code will throw boost::thread_resource_error().
int num_threads = 0;
while(true)
{
try
{
boost::thread thr(f);
++num_threads;
}
catch (const std::exception & e)
{
std::cout<<"Exception..."<