Next: Communication Up: C++-with-Ease language definition Previous: C++-with-Ease language definition

Process control

C++-with-Ease provides two forms of process creation:

To faciliate creation of multiple processes there is a replication constuct. In the replication (i @for 10) the variable i is created (local to the process creation statement) and stepped from 0 to 9 with a process created for each value of i. The initial value can be changed from 0 by adding a @from clause, and the step value changed from 1 by adding a @by clause.

Functions used in process creation statements are void functions and must be declared as process functions. This is acheived by replacing the void return type with @process in either a definition or declaration of the function.

In C++ -with-Ease , parameters for functions declared with @process must not be reference parameters, as the function may not be executing in the same address space.

To allow for passing of arbitrary parameter types, C++ -with-Ease marshalls data passed between processes (including process function parameters). See section 3.3 for more information.

The @process declaration must be used for all prototypes of the function and the function definition itself.

A @process declaration should occur before any process creation statements which use it. This ensures that an appropriate function declaration is available.

The code generation requires that parameters of @process functions take the form type identifer, i.e. that nothing follows the name of the parameter and that a parameter name is present. Thus a parameter declation void (*func)(void) is inappropriate, as is int hello[10].

In C++ -with-Ease , if a function is declared or defined apart from its @process declaration or definition, then all its parameters should be declared as references. This is because the function definition emitted by the @process directive converts parameters to references to avoid excess copying of data.

Next: Communication Up: C++-with-Ease language definition Previous: C++-with-Ease language definition



Tim MacKenzie <tym@cs.monash.edu.au>
Mon Apr 1 00:27:29 EST 1996