9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] semaphores
@ 2002-01-25 14:53 Russ Cox
  0 siblings, 0 replies; 10+ messages in thread
From: Russ Cox @ 2002-01-25 14:53 UTC (permalink / raw)
  To: 9fans

> Should that be `typedef struct Semaphore Sema;' in order for s->data to
> work?

probably struct Sema, but yeah.
i haven't actually compiled the code.
like i said, as soon as i wrote it
i discovered i didn't need it.



^ permalink raw reply	[flat|nested] 10+ messages in thread
* [9fans] Semaphores
@ 2006-10-22 23:05 Joel Salomon
  2006-10-22 23:21 ` Russ Cox
  2006-10-22 23:29 ` Steve Simon
  0 siblings, 2 replies; 10+ messages in thread
From: Joel Salomon @ 2006-10-22 23:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Homework help:  Could someone point me to an explanation of semaphore
implementation?  I'm supposed to implement something very like
semacquire(2) using TAS spinlocks (the professor says it's OK for me
to use lock(2), but not qlock), but in user mode.  He suggests using
signals for wakeup.

I'm looking at /sys/src/9/port/sysproc.c and /sys/doc/sleep.* not
quite understanding either.  Is there a readable description of
queueing on a semaphore in the literature somewhere?  Google's mostly
turning up assembler-heavy linux kernel one-upsmanship.

--Joel
-- 
In googlis non est, ergo non est.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [9fans] semaphores
@ 2002-01-16  7:48 nigel
  0 siblings, 0 replies; 10+ messages in thread
From: nigel @ 2002-01-16  7:48 UTC (permalink / raw)
  To: 9fans

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

As does the Lock module in Inferno.


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

From: Scott Schwartz <schwartz@bio.cse.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] semaphores
Date: Tue, 15 Jan 2002 22:54:56 -0500
Message-ID: <20020116035456.13985.qmail@g.bio.cse.psu.edu>

A previous edition's malloc used a pipe with a byte in it as a semaphore.
I thought that was a lovely solution, given shared file descriptors.

^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <rsc@plan9.bell-labs.com>]

end of thread, other threads:[~2006-10-22 23:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25 14:53 [9fans] semaphores Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2006-10-22 23:05 [9fans] Semaphores Joel Salomon
2006-10-22 23:21 ` Russ Cox
2006-10-22 23:29 ` Steve Simon
2002-01-16  7:48 [9fans] semaphores nigel
     [not found] <rsc@plan9.bell-labs.com>
2002-01-16  3:44 ` Russ Cox
2002-01-16  3:54   ` Scott Schwartz
2002-01-16 11:14     ` Boyd Roberts
2002-01-16 15:47     ` Ronald G Minnich
2002-01-25 10:30   ` Ralph Corderoy

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).