Boost logo

Boost Users :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-04-16 05:43:18


Axel <axel.azerty_at_[hidden]> writes:

> I m using a boost::thread_group instance to handle a limited number of
> threads. When the thread_group reach a defined size, I cal join_all() on
> it and I wonder how I could clear it without having to keep a pointer to
> its threads and call remove_thread() for each one. I thought about
> destruct th thread_group instance but I m not sure it's a good idea, so
> any advice is welcome.

You're right that there is not currently a way to do this, other than keep
track of all the threads in the thread group separately, and then remove
them. It might be worth extending thread_group to handle this.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net