SharedErrors.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Carl Hauser, October 31, 1987 1:01:34 pm PST
Chauser, November 20, 1990 3:41 pm PST
SharedErrors: CEDAR DEFINITIONS
~ BEGIN
Fork: PROC [children: LIST OF PROC];
Fork each of the children in such a manner that any errors they don't catch are passed along to the process (the parent) that called Fork. If no errors are passed to the parent Fork returns when all of the children have completed. If an error does occur in one of the children it is passed through the signal handling environment belonging the parent process. If a catch phrase handles the signal and does a non-local GOTO the children are aborted as part of UNWINDing in the parent.
In no case will Fork return until the children have completed in one way or another; hence it is OK to pass internal (nested) procedures to be forked.
The current implementation does not support RESUME.
END.
SharedErrors was created to deal with the situation in which what you would like to do is write a simple procedure call, but are required instead to fork some processes to simulate coroutines. A problem in this case is that errors occurring in the children normally are not examined by the signal handling environment carefully built up in the parent. SharedErrors provides just this facility, letting the children share the error handling environment of the parent.