Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!bbn!rochester!pt.cs.cmu.edu!k.gp.cs.cmu.edu!lindsay From: lindsay@k.gp.cs.cmu.edu (Donald Lindsay) Newsgroups: comp.lang.c++ Subject: Re: co-routine concept in C++? Message-ID: <3304@pt.cs.cmu.edu> Date: 14 Oct 88 20:19:11 GMT References: <649@laura.UUCP> <1191@ssc-bee.ssc-vax.UUCP> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 17 In article <1191@ssc-bee.ssc-vax.UUCP> lee@ssc-vax.UUCP (Lee Carver) writes: >It seems to me that an object, by >it self, of its very nature, constitues a co-routine. >Am I missing some (archane :-) definition of "co-routine"ness. A coroutine should have a stack, so that when it resumes, it can - be anywhere in its code space (rather than at a single entry point) - be at some procedure nesting level from the entry point - still have the local variables it was using, without having to design them into the (relatively, global) data part of the object. - be resumed in a utility routine which isn't conceptually part of the object (like, the IO system) Yes, you can fake it, but the fakes lose most of the advantages. -- Don lindsay@k.gp.cs.cmu.edu CMU Computer Science