home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!think.com!ames!pacbell.com!network.ucsd.edu!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Newsgroups: comp.lang.c++
- Subject: Re: Give me safe C++
- Message-ID: <1992Dec21.095145.13134@ucc.su.OZ.AU>
- Date: 21 Dec 92 09:51:45 GMT
- References: <1992Dec14.190553.14838@mole-end.matawan.nj.us> <1992Dec17.192301.23525@ucc.su.OZ.AU> <1992Dec17.235544.5983@rd.hydro.on.ca>
- Sender: news@ucc.su.OZ.AU
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- Lines: 50
- Nntp-Posting-Host: extro.ucc.su.oz.au
-
- In article <1992Dec17.235544.5983@rd.hydro.on.ca> twriter@rd.hydro.on.ca writes:
- >maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- >
- >> Next, I feel NO language has addressed the concept
- >>of coroutines (except possibly Simula?). C provides
- >
- >There was (is) a language called Concurrent Euclid which was invented at
- >the University of Toronto some years ago. In my opinion, it addressed
- >the problem of concurrency (coroutines) quite effectively.
-
- In my thinking, processes differ from coroutines.
- First, processes operate concurrently, and so must be synchronised,
- whereas coroutines use a single thread of control that
- swaps back and forward under the control of the coroutines
- themselves (transfer of control is explicit).
-
- The other difference is that coroutines share the environment
- they are instantiated in. If Unix processes cause the stack
- to be duplicated, then coroutines cause the stack to fork.
- >
- >When the program starts up it immediately creates two processes
- >(coroutines) up and down. The output might look something like this.
- >
- >1 >2 >3 >2 >3 >4 >3 >2 >1 >0 >-1 >0 >...
-
- Random. Coroutines, on the other hand, are completely
- deterministic. They are like subroutines for which the
- caller and callee cannot be distinguished. (Or rather,
- the distinction is relative).
-
- >
- >Euclid also provides a means of synchronizing processes using signals
- >and conditions although I don't remember enough to describe it.
- >
-
- Coroutine are sometimes used to simulate processes.
- However a proper coroutine facility would have to provide
- the shared memory context and forked local context.
- Of course this can be simulated using objects .. but simulations
- are not the same as syntax. Inventing a syntax for filters
- is not so hard .. but I've never got beyond that. Perhaps
- objects are the only general solution?
-
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-