|
It has been mentioned already that processes can be created by other processes dynamically at interpretation time. This is indicated in a block diagram by a create line symbol (a dashed line from the creating process to the created process with a filled arrowhead at the created process). In figure 18, for example, instances of process P2 may be created by instances process P1. In this case there is only one instance of P1: the number of instances is not given so the initial number is one, and because no process creates instances of P1 it remains one. The creation of a process is always done during a transition of the creating process, using the create construct (in the example of figure 18 during the transition of P1 from S1 to T2). The create symbol (a rectangle with double lines at the top and bottom see P1 in figure 18) contains the name of definition for the created process optionally followed by a parameter list. When creating a process, actual parameters may be given to the created process. The corresponding formal parameters have to be defined in the definition of the created process (see the formal parameters V1 and V2 in process P2 in figure 18). Rules hold for this parameter passing (similar to the rules for value passing by signals - see 'Signals and data'). The creating and created process must belong to the same block. The predefined expressions SELF, OFFSPRING and PARENT provide the identity of the corresponding process instance (see 'Identifying processes' for more details). Figure 18: Dynamic process creation If it has been defined there is a maximum number of process instances of the created process definition, and an attempt is made to create more processes, no process will be created and the expression OFFSPRING of the creating process gives the value Null. A process can only be terminated only by itself, by using the stop construct shown a stop symbol (a diagonal cross - see figure 19). Afterwards, all the data values and the contents of the input queue are discarded. Figure 19: Termination of a process |
Contact the webmaster with
questions or comments about this web site. |