Boost logo

Boost :

From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-04-30 07:29:04


I have several implementations of the same function with different algorithms. I want to launch these in parallel and join the one finishing the first, and stop the others.

I have started and in my solution I need to wrap the function in order to make the needed synchronization, which seam not quite satisfactory.

Is there an easy way to join the first thread that finish from a thread group and getting it?

    boost::thread_group tg;
    // ...
    boost::thread* first = tg.join_one();

Do you find useful this feature?

Vicente Juan Botet Escriba

Boost list run by bdawes at, gregod at, cpdaniel at, john at