Re: How to wait for multiple threads simultaneously?
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Thu, 14 Feb 2008 13:28:53 -0800 (PST)
On Feb 13, 11:53 pm, Rainer Weikusat <rweiku...@xxxxxxxxxxx> wrote:
But they typically don't loop until something happens. This is just a
special case the code needs to be prepared for, while it is the exact
behaviour of a spin lock.
I think that's based on the mistaken assumption that the only reason
the loop would run more than once is in the rare case where there's a
spurious wakeup. But that's not true. One common reason you would loop
on a pthread_cond_wait is when the condition may have been consumed by
other threads.
That is, spinning is part of the normal synchronization process. It's
not just a workaround for a bizarre side-effect.
DS
.
- Follow-Ups:
- Re: How to wait for multiple threads simultaneously?
- From: Rainer Weikusat
- Re: How to wait for multiple threads simultaneously?
- References:
- How to wait for multiple threads simultaneously?
- From: chjfth
- Re: How to wait for multiple threads simultaneously?
- From: David Schwartz
- Re: How to wait for multiple threads simultaneously?
- From: Rainer Weikusat
- Re: How to wait for multiple threads simultaneously?
- From: David Schwartz
- Re: How to wait for multiple threads simultaneously?
- From: Rainer Weikusat
- Re: How to wait for multiple threads simultaneously?
- From: David Schwartz
- Re: How to wait for multiple threads simultaneously?
- From: Rainer Weikusat
- How to wait for multiple threads simultaneously?
- Prev by Date: Re: pthread_cond_signal is mutex lock/unlock needed ?
- Next by Date: Re: portable application
- Previous by thread: Re: How to wait for multiple threads simultaneously?
- Next by thread: Re: How to wait for multiple threads simultaneously?
- Index(es):
Relevant Pages
|