boost::thread_resource_error

Hello, I am encountering the following error: ********************************** terminate called after throwing an instance of 'boost::thread_resource_error' what(): boost::thread_resource_error Abandon ********************************** trying to run a threadgroup of 500 threads as follows: thread_group * thgrp = new thread_group(); for (int i = 0; i < NUMTHREADS; i++) { thgrp->create_thread(bind(&simulate, i, 100, 0.05, 0.2, 1.0, 100, 100, endPrices)); } thgrp->join_all(); Can anyone please help. I don't understand why I get this error as I have no resource problems with my machine. Julien.

On Tue, Oct 19, 2010 at 07:17, Julien Martin
Can anyone please help. I don't understand why I get this error as I have no resource problems with my machine.
How much memory does each thread need? It doesn't have to be that big a simulation to use a few MB, which pushes the usage over a few GB... Regardless, you should consider whether you really need 500 threads. That's a good 2 orders of magnitude more than normal hardware can support, and thus highly discouraged. ~ Scott

Scott,
Yes you're right. I am going to alter the design of my app and use less
threads.
Thanks,
J.
2010/10/19 Scott McMurray
On Tue, Oct 19, 2010 at 07:17, Julien Martin
wrote: Can anyone please help. I don't understand why I get this error as I have
no
resource problems with my machine.
How much memory does each thread need? It doesn't have to be that big a simulation to use a few MB, which pushes the usage over a few GB...
Regardless, you should consider whether you really need 500 threads. That's a good 2 orders of magnitude more than normal hardware can support, and thus highly discouraged.
~ Scott _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Julien Martin
-
Scott McMurray