Is there a limit for the number of threads created by thread_group.create_thread() ?
Hi, all When I use thread_group to create 400 threads , it throws a boost::thread_resource_error ? Is there a limit for the number of threads created by thread_group.create_thread() ? Thanks so much. Andy. Best Regards.
he xiang wrote:
Hi, all When I use thread_group to create 400 threads , it throws a boost::thread_resource_error ? Is there a limit for the number of threads created by thread_group.create_thread() ? Thanks so much.
There is no such artificial limit on the boost side. boost::thread_resource_error is always thrown, if the corresponding OS cannot fulfill the corresponding native request, e.g. if on Windows _beginthreadex fails or if on a pthread environment pthread_create fails. The most reasonable assumption is, that your OS cannot provide these 400 threads at the point where you try to get them. Greetings from Bremen, Daniel Krügler
participants (2)
-
Daniel Krügler
-
he xiang