From: "Russ Cox" <rsc@swtch.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] waitfor() call question?
Date: Thu, 12 Oct 2006 23:00:26 -0400 [thread overview]
Message-ID: <ee9e417a0610122000r1cf90015wc7775089fafc42bb@mail.gmail.com> (raw)
In-Reply-To: <e05cb1dde77f831e8cc594d5b40591fd@plan9.jp>
> Nemo's book (http://lsub.org/who/nemo/9.intro.pdf, page 91) gives code
> for waiting for a particular descendant process if that's what's
> wanted. Actually, he uses it for the immediate child process, which
> makes me wonder—after the child process has exited, can the parent
> wait() for a grandchild?
Nope.
> Why is waitfor() "occasionally unavoidable" on UNIX?
Because sometimes what would be multiple processes on Plan 9
is a single process on Unix, depending on the implementation of
the thread library, and two shared-memory procs each waiting for
their own children need not to get the other's child.
You could have some shared list of accidentally-waited-for children
but then the coordination to wake up the guy who is actually
waiting gets cumbersome.
Russ
next prev parent reply other threads:[~2006-10-13 3:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 21:34 ISHWAR RATTAN
2006-10-12 21:50 ` Russ Cox
2006-10-13 1:27 ` Joel “chesky” Salomon
2006-10-13 3:00 ` Russ Cox [this message]
2006-10-13 8:43 ` Bruce Ellis
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=ee9e417a0610122000r1cf90015wc7775089fafc42bb@mail.gmail.com \
--to=rsc@swtch.com \
--cc=9fans@cse.psu.edu \
/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).