Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #203

Re: cond signal wait

From Alexander Terekhov <terekhov@web.de>
Newsgroups comp.programming.threads
Subject Re: cond signal wait
Date 2011-05-28 15:48 +0200
Organization A noiseless patient Spider
Message-ID <4DE0FD20.8FA7464A@web.de> (permalink)
References (4 earlier) <a05141df-cede-4929-9e8d-4b9394fd6858@22g2000prx.googlegroups.com> <8ab4e07e-2b9b-4375-b425-dc03e6d017d5@f15g2000pro.googlegroups.com> <c7b7a994-fb4d-4bf9-bb20-8bf9fceaa5b9@35g2000prp.googlegroups.com> <fb054ce9-8efe-4540-9cdd-cdfd0790ce3d@s16g2000prf.googlegroups.com> <a014c2ff-7449-4010-b104-1a8ee6309eea@34g2000pru.googlegroups.com>

Show all headers | View raw


David Schwartz wrote:

[... "if" v. "while" ...]

> It's the same point. If the condition variable code had access to the
> predicate, it could make a sensible decision of whether to repeat the
> wait or not. But since the condition variable implementation has no
> access to the predicate, the only sensible way to handle a case where
> there might have been a signal is to return.

AFAIK, when Hoare invented condition variables he saw only signal (no
broadcast) operation and "if" (not "while") for the wait with signalling
done under protection of mutex (hand-off of mutex ownership from
signaller to signallee akin to semas). Later, MESA folks introduced
broadcast, changed "if" to "while", and allowed signalling without
holding mutex.

regards,
alexander.

Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

cond signal wait p6 c6d6 <p6c6d6@gmail.com> - 2011-05-24 18:56 -0700
  Re: cond signal wait Anthony Williams <anthony.ajw@gmail.com> - 2011-05-25 08:46 +0100
    Re: cond signal wait p6 c6d6 <p6c6d6@gmail.com> - 2011-05-25 05:44 -0700
      Re: cond signal wait Anthony Williams <anthony.ajw@gmail.com> - 2011-05-25 15:57 +0100
        Re: cond signal wait p6 c6d6 <p6c6d6@gmail.com> - 2011-05-25 08:34 -0700
          Re: cond signal wait Anthony Williams <anthony.ajw@gmail.com> - 2011-05-25 16:53 +0100
            Re: cond signal wait Alexander Terekhov <terekhov@web.de> - 2011-05-25 19:16 +0200
          Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-26 09:51 -0700
          Re: cond signal wait Joshua Maurice <joshuamaurice@gmail.com> - 2011-05-26 14:48 -0700
            Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-26 23:20 -0700
              Re: cond signal wait Joshua Maurice <joshuamaurice@gmail.com> - 2011-05-27 14:50 -0700
                Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-27 15:15 -0700
                Re: cond signal wait Alexander Terekhov <terekhov@web.de> - 2011-05-28 15:48 +0200
            Re: cond signal wait Alexander Terekhov <terekhov@web.de> - 2011-05-27 16:01 +0200
              Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-27 12:34 -0700
                Re: cond signal wait Alexander Terekhov <terekhov@web.de> - 2011-05-28 14:24 +0200
                Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-29 01:33 -0700
                Re: cond signal wait Alexander Terekhov <terekhov@web.de> - 2011-05-31 15:32 +0200
                Re: cond signal wait David Schwartz <davids@webmaster.com> - 2011-05-31 14:07 -0700

csiph-web