Path: utzoo!utgpu!watmath!att!pacbell!ames!pasteur!ucbvax!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!wuarchive!swbatl!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.unix.wizards Subject: Re: Re^2: What kinds of things would you want in the GNU OS? Message-ID: <5568@ficc.uu.net> Date: 7 Aug 89 12:38:39 GMT References: <160@uucs1.UUCP> <8311@boring.cwi.nl> Organization: Xenix Support, FICC Lines: 26 [ gaf@uucs1.UUCP (gaf) wants an n-way wait() ] In article <8311@boring.cwi.nl>, guido@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@ficc.uu.net, +1 713 274 5180. | "The sentence I am now Personal: peter@sugar.hackercorp.com. `-_-' | writing is the sentence Quote: Have you hugged your wolf today? 'U` | you are now reading"