9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] new system calls - semacquire, semrelease
Date: Sun, 26 Mar 2006 19:59:52 +0100	[thread overview]
Message-ID: <16e23f18e947c3c8ea0d75d5c33bf4d3@terzarima.net> (raw)
In-Reply-To: <775b8d190603260911h73f5b3ceqb03c5724ab95f6fb@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

here's a different little hack that's more unix-specific,
which i borrowed from unix libthread (i think that's where i saw it,
although it might be well-known in fcntl land).

a parent process needs to know whether a child has successfully done an exec
of an arbitrary program (so it's hard to have that program tell the parent).
the parent makes a pipe, marks the child's end as close-on-exec, forks, and then
reads its end of the pipe.  if the exec succeeds, the read returns 0; if the
exec fails, the child writes the diagnostic on the pipe, so again the read returns something.

[-- Attachment #2: Type: message/rfc822, Size: 3609 bytes --]

From: "Bruce Ellis" <bruce.ellis@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] new system calls - semacquire, semrelease
Date: Mon, 27 Mar 2006 03:11:45 +1000
Message-ID: <775b8d190603260911h73f5b3ceqb03c5724ab95f6fb@mail.gmail.com>

boyd would put keys in pipes so core dumps (incidental or nasty)
wouldn't give them away.  interesting to think about, given my
current plumbing problems (water not bytes).

brucee

On 3/26/06, Lyndon Nerenberg <lyndon@orthanc.ca> wrote:
>
> On Mar 25, 2006, at 8:12 AM, Russ Cox wrote:
>
> > much like the old trick of storing a byte in a pipe
> > and using it as an interprocess lock.
>
> It's a brilliant trick. It let us write some very portable code (to
> windows, too, no less) with almost no effort.  Don't knock
> inginuity.  (Or insanity.  But that's just labels ...)
>
> --lyndon
>

      reply	other threads:[~2006-03-26 18:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24  0:43 Russ Cox
2006-03-24  0:52 ` Bruce Ellis
2006-03-25  4:50   ` William Josephson
2006-03-25  6:46     ` Bruce Ellis
2006-03-25  9:22     ` Charles Forsyth
2006-03-25 16:04       ` Bruce Ellis
2006-03-25 16:12         ` Russ Cox
2006-03-26  7:27           ` Lyndon Nerenberg
2006-03-26 17:11             ` Bruce Ellis
2006-03-26 18:59               ` Charles Forsyth [this message]

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=16e23f18e947c3c8ea0d75d5c33bf4d3@terzarima.net \
    --to=forsyth@terzarima.net \
    --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).