Longjmping back, and back again; Coroutines in C

Chris Torek chris at mimsy.umd.edu
Tue Nov 21 05:16:23 AEST 1989


In article <457 at enea.se> jerker at enea.se (Jerker W}gberg) writes:
>instead of actually switching stacks, I use the "real" stack but
>swap it in and out of malloced memory.
>
>1. Can somebody explain why this fails on a SUN4.

I suspect it defers writing into the stack until absolutely necessary.
You thus save the data before it exists.

Your technique will also fail on machines that have several simultaneously
active stacks (e.g., Pyramid) or no stack (probably no such machines run
C).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list