Newsgroups: comp.unix.wizards Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: alloca... (and setjmp/longjmp coroutines) Message-ID: <1988Jun13.210521.897@utzoo.uucp> Organization: U of Toronto Zoology References: <11902@mimsy.UUCP>, <599@goofy.megatest.UUCP> Date: Mon, 13 Jun 88 21:05:21 GMT > I'm no C wizard... but it seems to me that longjmp is the most suitable > technique going, by default... What else is there? You could use [abuse?] > sigvec and kill... In the same way that you're abusing longjmp, you mean? The fact is, there is -->**NO**<-- portable way to accomplish what you're trying to do. None. Coroutines simply cannot be done without some degree of cooperation from the language or the compiler. C doesn't cooperate on the language level, so you're stuck. Yes, you can write code that will more-or-less work, so long as the compiler doesn't spring any surprises on you. Portable it isn't. That being the case, the proper approach is to admit defeat, study your compiler carefully, and write twenty lines of assembler to do things right. -- Man is the best computer we can | Henry Spencer @ U of Toronto Zoology put aboard a spacecraft. --Von Braun | {ihnp4,decvax,uunet!mnetor}!utzoo!henry