Boost logo

Boost Users :

From: Dale Peakall (dale.peakall_at_[hidden])
Date: 2002-03-08 05:39:42


> On Thu, 2002-03-07 at 17:01, simonwlb wrote:
> > I'm using thread::yield() in my multi-threaded cross-platform
> > application to avoid "CPU burn".
> <snip>
> > {
> > if( m_x->isReady() )
> > doSomething();
> <..>
> >
> > If the answer is "you should almost never poll like that -
> try to use
> > mutexes etc. as much as possible" please say so (I'm a newbie to
> > threads)!
>
> The answer is actually probably conditionals plus mutexes. Presumably
> one thread is doing something, and other threads are waiting for it to
> be ready. This is a standard producer/consumer model.

{
        boost:


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