Re: How to wait for multiple threads simultaneously?



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
.



Relevant Pages

  • Re: How to wait for multiple threads simultaneously?
    ... special case the code needs to be prepared for, while it is the exact ... behaviour of a spin lock. ... a spin lock is something which does not cause a thread trying ... loop which is busy-waiting until some condition is true. ...
    (comp.os.linux.development.apps)
  • Re: Function to extract values
    ... If you don't need a full-word match, you can just use the InStr function to ... do a nested loop: outer loop iterates through each name in column A. Inner ... It becomes more complicated if you need an exact match of the full word. ... with the individual words within that string, ...
    (microsoft.public.excel.programming)
  • Re: About dispatching process
    ... spin loop and a disabled loop? ... A spin loop is a loop while attempting to acquire a spin lock. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Socket selection.
    ... +> Pawel Jakub Dawidek wrote: ... +>> we countinue looking for exact match. ... +>> I wonder if this is ok, that we change pointer every time we find a ... But we have loop there: ...
    (freebsd-net)
  • Re: Someone
    ... basic) in order to check my program *Binomial* exactness due to his weakness in this program language. ... After Afonso suggested to other to do exactly THAT for those who ... verify the program provided exact results he call me a LIAR. ... The error was the convention of IGNORING a LOOP before the ...
    (sci.stat.math)