home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!osr
- From: Jack_Palevich@taligent.com (Jack Palevich)
- Newsgroups: comp.os.research
- Subject: Re: Lightweight threads and "real" users
- Message-ID: <17n06qINN793@darkstar.UCSC.EDU>
- Date: 29 Aug 92 04:59:06 GMT
- References: <13cn3eINN8cn@darkstar.UCSC.EDU> <13sb8pINNn28@darkstar.UCSC.EDU>
- Organization: Taligent, Inc.
- Lines: 31
- Approved: comp-os-research@ftp.cse.ucsc.edu
- NNTP-Posting-Host: ftp.cse.ucsc.edu
- Originator: osr@ftp
-
- The best practical advice I've seen on using lightweight threads is the DEC
- SRC report "An Introduction to Programming with Threads", by Andrew D.
- Birrell. (35 pages. (C) 1989 Digital Equipment Corp. Systems Research
- Center, Palo Alto, CA. I believe that the SRC will mail you a paper copy of
- this report on request, but I don't know their full address.)
-
- The DEC SRC report seems to have been influenced by earlier Xerox PARC work
- on the Mesa language. Mesa had language support for threads, monitors and
- conditions.
-
- Several years ago, when I started to program concurrently, a wise veteran
- gave me this advice:
-
- 1) Within an address space use monitors & conditions, rather than raw
- semaphores.
-
- 2) Never call out of your scope with a monitor held.
-
- 3) Between address spaces use synchronous send-and-wait-for-reply
- messaging, rather than asynch messaging.
-
- -- Of course, because I was young and full of beans, I ignored his advice.
- I said, "But why must I do this? Can't I bend these rules just a little
- bit? Surely one additional little feature won't get me in trouble!"
-
- The veteran just smiled sadly.
-
- Now, several years later, I have come to believe in these rules
- whole-heartedly. If you follow them, then you should have no problems using
- concurrency. If you don't, you'll gain a deeper understanding of the
- complexity of concurrent programming. :-)
-