Stack Frames

Eugene D. Brooks III brooks at lll-crg.ARpA
Thu Feb 20 09:39:28 AEST 1986


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.



More information about the Comp.lang.c mailing list