9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@9fans.net
Subject: Re: [9fans] double wakeup disallowed
Date: Wed, 28 Oct 2009 09:43:28 +0000	[thread overview]
Message-ID: <d73c6a7a4b7a22bffde73a5b0ec7a0b7@terzarima.net> (raw)
In-Reply-To: <8c9a75f61b57905d955240c33d4d805c@ladd.quanstro.net>

it isn't protecting against double wakeups, but
instead detects a bug in the code. there's an invariant
that the rendez and the process point to each other
while the process is asleep.
wakeup checks that invariant.
there are three primitives (sleep, wakeup and note)
and at different times in the past at least one of them
has been wrong; it's wise to check the invariant.

>and only disallows waking up a process that's not
>sleeping or sleeping on another Rendez.

but wakeup doesn't wakeup a particular process, it
wakes up exactly the process sleeping on the given Rendez,
so the situation can't arise.



  reply	other threads:[~2009-10-28  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 23:38 erik quanstrom
2009-10-28  9:43 ` Charles Forsyth [this message]
     [not found] <<d73c6a7a4b7a22bffde73a5b0ec7a0b7@terzarima.net>
2009-10-28 13:24 ` erik quanstrom
2009-10-28 15:29   ` Russ Cox
2009-10-28 15:45     ` Charles Forsyth
2009-10-28 16:14       ` erik quanstrom
2009-10-30  5:45         ` Russ Cox
     [not found] <<dd6fe68a0910292245x70f83d7bl8957356abda38201@mail.gmail.com>
2009-10-30 14:11 ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d73c6a7a4b7a22bffde73a5b0ec7a0b7@terzarima.net \
    --to=forsyth@terzarima.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).