
I have different threads which have to work on completely different input and output data (non critical sections): an atomic operation per thread, each one with different time execution but everyone with an intense use of the CPU. Let's say I have 10 operations to perform (10 threads): I would like to run concurrently only 2 threads because of resource consumption.
My problem is that when a threads ends its execution, I would like to suddenly start another thread performing operation 3, in order to have constantly 2 threads working, and so on until the end of operations.
How can I achieve this? I thought to insert my threads into a vector...but I have no idea on how start and join them in order to obtain what described above.
Are you looking implicit for a thread_group? http://www.boost.org/doc/libs/1_46_0/doc/html/thread/thread_management.html#... Regards, Olaf