Pyramid context switches & chgstack(2) - How?

Mike Mc Gaughey mmcg at moncsbruce.oz
Wed Apr 13 03:54:36 AEST 1988


	I am trying to write a coroutine scheduler to run on a
pyramid 90x under 4.2bsd.  The idea is to maintain multiple stacks,
and have a scheduling routine (invoked by the interval timer)
to switch between various stacks.  On the pyramid, this is nontrivial
as there are actually two stacks - a normal stack and a register file
(used to save registers on a call; registers do not get saved on
the normal stack).  The register file is (I believe) inaccessible by
mere mortals.  There is a kernal call provided to change stacks -
chgstack(2) - but there seems to be no way to create a new stack to
switch to (because chgstack seems to want to set the various stack
pointers and then return - on the uninitialised stack).
Thus, there is no way to have more than one stack.
	This problem has arisen on a number of related works (for instance,
ICON on the pyramid does not support coroutines, and we haven't been able
to do it either).

	Has ANYONE solved this problem?

	If so, could you please send me an explanation and examples?

I already have some code that runs quite happily on a vax (normal stack);
the problems are all certainly due to the pyramid architecture.

					Thanks a lot.
					    Mike.

					mmcg at moncsbruce.oz



More information about the Comp.unix.wizards mailing list