9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: G. David Butler gdb@dbSystems.com
Subject: [9fans] adding separate rendezvous space to Plan9
Date: Tue, 16 Sep 1997 12:12:29 -0500	[thread overview]
Message-ID: <19970916171229.TIS5YgmtulboR91ILDIPQojEcjdJsiyx1nRk7Zpdieg@z> (raw)

I added a new flag to rfork() yesterday.  (This one is ok; really!)

The name RFCRENDG (RForkCleanRENDezvousGroup) is compatable with
the others like RFCNAMEG.  There is no RFRENDG because copying the
rendezvous space is not helpful.  If the flag is not specified
the rendezvous space is shared.

This was necessary to enhance the user-space lock stuff I added for C.
In liblock I added qlock(), rlock(), incref() and friends.
I needed RFCRENDG because I used rendezvous to implement qlock
and the rendezvous space can get dirty.

I did that because many of the C library functions, for example, are
not safe to call from processes rforked with RFMEM.  After thinking
about it for a while I decided that instead of making every program
pay for the possibility of RFMEM, I would enhance the lock library
to make it easy to add protection around the unsafe calls.  If you
look at the malloc.c in the ndb source, you will see what I mean.
Instead of what was done in ndb, just surround calls to malloc()
and free() with either lock() and unlock() or qlock() and qunlock()
depending on the need of that program.

I found two other problems.  In /sys/src/ape/lib/ap/plan9/sys9.h there
is a reference to RFREND.  I guess someone thought this was a good
idea too, but did not follow through.  The name does not match the
others so I used RFCRENDG.  Should I ask what Inferno or that other
thing uses?  Do I care?

And in /acme/bin/src/win.l there is a RFMEM in the first rfork() in
the routine run() that shouldn't be there.  (I found this when I
reordered the Ebadarg tests in the rfork system call in the kernel.)

I only found two places that had to change as a result, a RFCRENDG
was added to newns() in the libauth libraries for both C and alef.

I'm sure there are other places in, especially, alef code to take
advantage of the new flag, but not necessary.

David Butler
gdb@dbSystems.com




             reply	other threads:[~1997-09-16 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-16 17:12 G.David [this message]
1997-09-16 17:27 howard

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=19970916171229.TIS5YgmtulboR91ILDIPQojEcjdJsiyx1nRk7Zpdieg@z \
    --to=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).