Boost logo

Boost :

From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-04-27 13:27:01


Hi,

The Boost.Thread library provides a thread_group class for a collection of threads that are related in some fashion. This collection is dynamic, i.e. we can add and remove threads to this collection. When this collection is known at the group creation and can not change a static thread group could be useful.

This template class thread_tuple_n will have the same operations than a thread_group, join_all, interrupt_all and size and could be used as follows:

void free_function() {
    // ....
}

class X {
public:
    void mf() {
    // ....
    }
};

class Y {
public:
    void operator()() {
    // ....
    }
};

X x;

Y y;

thread_tuple_3 tt(free_function, make_pair(&X::mf, x), y);
// ...
tt.interrupt_all();
// ...
tt.join_all();

Best

_____________________
Vicente Juan Botet Escriba


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