9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] what am i missing
Date: Wed, 25 Apr 2012 16:14:40 -0400	[thread overview]
Message-ID: <CADSkJJVeG7ZqCpnqVd0SvRhKmnWUrewX04kYVX-VTUb50Uemqw@mail.gmail.com> (raw)
In-Reply-To: <44a20375d50e77dfb05d75c5ab989474@brasstown.quanstro.net>

On Wed, Apr 25, 2012 at 4:06 PM, erik quanstrom <quanstro@quanstro.net> wrote:
> good point.  procrfork() does nowait.  but then how do i get
> a wait message.  i'm really hoping the answer is not "you don't".

I don't believe you have looked at the context here.

This is only used by procexec, which is trying to simulate
an exec replacing a proc.  It does that by setting p->needexec=1
and jumping back into the scheduler.  The scheduler will call
_schedexec, which does an rfork of its own (not procrfork),
the "exec"ed program runs in the child, and the parent waits
for the wait message saying the child is done.  An unexpected
wait message shold not come in, but if one does, might as well
be tidy and free it before continuing the loop.

This is not Linux.  Each individual proc (thread) has its own
set of children, so the only wait message that should arrive
on that proc is the one it expects.  Other procexecs running
in other procs will not affect it.

Russ


  reply	other threads:[~2012-04-25 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 19:46 erik quanstrom
2012-04-25 20:03 ` Russ Cox
     [not found] ` <CADSkJJV_C6qrqDDXgRm0jPwRWoX2-YckOCf1bMati625Co5CMg@mail.gmail.c>
2012-04-25 20:06   ` erik quanstrom
2012-04-25 20:14     ` Russ Cox [this message]
     [not found]     ` <CADSkJJVeG7ZqCpnqVd0SvRhKmnWUrewX04kYVX-VTUb50Uemqw@mail.gmail.c>
2012-04-25 20:37       ` erik quanstrom
2012-04-25 21:00         ` Russ Cox
     [not found]         ` <CADSkJJURoTSsuNHWpHb6=yWvQh9-DpQ3h+nMxC=s0AdYUj-h_A@mail.gmail.c>
2012-04-25 21:10           ` 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=CADSkJJVeG7ZqCpnqVd0SvRhKmnWUrewX04kYVX-VTUb50Uemqw@mail.gmail.com \
    --to=rsc@swtch.com \
    --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).