From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] new system calls - semacquire, semrelease
Date: Sat, 25 Mar 2006 11:12:05 -0500 [thread overview]
Message-ID: <b6e833b996170a0c5fdeced37ce27961@swtch.com> (raw)
In-Reply-To: <775b8d190603250804l45b2c25ag865617b928ca0ab5@mail.gmail.com>
> there is lock(2) in the public inferno distribution. the implementation is amusing.
much like the old trick of storing a byte in a pipe
and using it as an interprocess lock.
the implementation of the plan 9 semaphore code,
by the way, is a bit more involved than one might
first expect. the hard part is accessing *addr safely
without using a qlock (which would block) in semrelease.
(and you can't access *addr while holding a lock
either, since you're not allowed to touch user memory
while holding locks.) i verified it with spin to double-check.
russ
next prev parent reply other threads:[~2006-03-25 16:12 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 [this message]
2006-03-26 7:27 ` Lyndon Nerenberg
2006-03-26 17:11 ` Bruce Ellis
2006-03-26 18:59 ` Charles Forsyth
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=b6e833b996170a0c5fdeced37ce27961@swtch.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).