Re^2: What kinds of things would you want in the GNU OS?
Peter da Silva
peter at ficc.uu.net
Mon Aug 7 22:38:39 AEST 1989
[ gaf at uucs1.UUCP (gaf) wants an n-way wait() ]
In article <8311 at boring.cwi.nl>, guido at piring.cwi.nl (Guido van Rossum) writes:
> Sounds like you need multiple threads in a single address space, or
> light-weight threads as they are referred to in a discussion of the
> subject in neighboring newsgroups. I agree that they are *very* nice to
> have in an OS.
An n-way wait can be implemented by using N threads, having each of them
waiting on a seperate event, and having a thread signal the mainline
when its event occurs. It can also be implemented using software interrupts...
(or in UNIX terms, signals). It's usually desirable, though, to implement
an n-way wait anyway, because it may be more efficient. When one is doing
this sort of thing, one is often involved in process monitoring or control,
where efficiency is an important factor.
Conversely, if you have an N-way wait, it's relatively easy to implement
threads. It's like the various process co-ordination tools: semaphores,
monitors, messages, etc... you can use any of them to implement the others.
It's generally desirable to have at least a couple of them be primitives
in any real system... and define all of them in a portable one.
--
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter at ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter at sugar.hackercorp.com. `-_-' | writing is the sentence
Quote: Have you hugged your wolf today? 'U` | you are now reading"
More information about the Comp.unix.wizards
mailing list