Boost logo

Boost Users :

Subject: Re: [Boost-users] Conditional thread join
From: David Abrahams (dave_at_[hidden])
Date: 2010-11-22 21:47:23


At Mon, 22 Nov 2010 16:12:22 -0800 (PST),
Chris wrote:
>
> No, I want to stop when either thread finishes
> something like a join_any(). Does that exist?
>
> greetings
> Chris
>
> } while (...);
> } // Write()
>
>
> boost::thread thrd1(Read);
> boost::thread thrd2(Write);
>
> // I don't want the following
> thrd1.join();
> thrd2.join();
>
> No, I want to stop when either thread finishes
> something like a conditional join. Does that exist?

Sounds like a job for condition variables.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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