Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.c Subject: Re: How many stacks? (WAS: alloca(), #if, and other controversial things...) Message-ID: <1274@garth.UUCP> Date: 22 Aug 88 21:27:25 GMT References: <8808171410.AA05337@ucbvax.Berkeley.EDU> <1259@garth.UUCP> <5250@killer.DALLAS.TX.US> <1270@garth.UUCP> <5531@june.cs.washington.edu> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 24 >>I don't understand: the concept of a single big general purpose stack is >>fundamental to any language that implements recursion. > >I think that coroutines for a recursive language are most naturally >implemented in a language that has multiple stacks. Silly me, and I thought I was talking about C. Multitasking systems either give each task its own stack which is a single big general purpose stack, or convert the stack into a tree with each task only seeing a single unified stack. Even if the system requires a fixed size frame, local storage can be allocated on the heap, chained into the frame. Like other tricks, local storage need not be implemented in particular fashion as long as its semantics are fixed. Be careful not to confuse implementation with interface. ---------------------------------- talk about user hostile systems: File to include [none]? type *none* and it aborts.