Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!lll-crg!brooks From: brooks@lll-crg.ARpA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Stack Frames Message-ID: <1269@lll-crg.ARpA> Date: Wed, 19-Feb-86 18:39:28 EST Article-I.D.: lll-crg.1269 Posted: Wed Feb 19 18:39:28 1986 Date-Received: Fri, 21-Feb-86 05:59:39 EST References: <1084@brl-smoke.ARPA> Reply-To: brooks@lll-crg.UUCP (Eugene D. Brooks III) Organization: Lawrence Livermore Labs, CRG Group Lines: 21 The idea of creating a new context with each entry to a {} block, or at least for some very special ones, has some merit worth thinking about. Suppose you have extended C for parallel programming. main() { int i; int shared; forall(i from 0 to 9) { int private; /* lines of code */ } } if the forall loop is looked at as a fork of 10 lines of control which join up at the closing brace then the opening brace must do something special to the stack frame so that 10 seperate copies of 'private' are generated. The int 'shared' is on the stack of the parent and can be read or written by all of the lines of control but the stack splits into 10 segments at the opening brace of the forall loop.