I'm not aware of any task management stuff that comes with the boost
libraries. boost::thread is pretty much a straightforward wrapper to
lower-level threading concepts.
I would usually build up some kind of task queue/stack that is either
locking or concurrent and non-locking that manages the tasks. Then
you can start M threads where M is the number of cores on your
machine. These threads can then "steal" the work from the task queue,
and/or add new tasks to the task queue until the tasks are finished.
TBB (intel thread building blocks) has some of this already in place
to make it easier to write these kinds of programs, but I typically
roll my own and use boost threads directly as I have seen better
performance.
Brian
On Sun, Oct 24, 2010 at 1:44 PM, Julien Martin
Hello, I am writing a program that needs to run N simulations with N >10 000. Obviously, I cannot instantiate N threads at the same time but I cannot run the simulations sequentially either. Can anyone please advise me how to design my program using the boost threading library and concepts please? Thanks in advance, Julien.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users