Boost logo

Boost :

Subject: [boost] [thread] Do we need thread_group now?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-04-10 13:32:20


Hi,

now that we have Boost.Container and Boost.Thread (trunk) uses
Boost.Move, boost::thread_group has less sense.

I was thinking on replacing it by some generic algorithms as join_all,
interrupt_all that work with generic containers so that the user can use
the best containers adapted to her own needs.

   typedef boost::container::vector<boost::thread> thread_vector;
   {
     thread_vector threads;
     for (int i = 0; i < 10; ++i)
     {
       threads.push_back(boost::thread(&increment_count));
     }
     join_all(threads);
   }
   {
     thread_vector threads;
     for (int i = 0; i < 10; ++i)
     {
       threads.push_back(boost::thread(&increment_count));
     }
     interrupt_all(threads);
   }

Could boost::thread_group be deprecated once these generic algorithm are
released? Or, is there something really useful on the thread_group class
that needs to be preserved or even improved?

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk