|
For any signal sent by a process there must be one and only one destination. This destination can be specified
In both cases it is required that there exist a communication path (in the form of signal routes and channels) between the sending and the receiving process. The allowed communication path for the signal can by restricted by specifying in the output the signal route or channel on which the signal should be sent. In any case, the destination process has to exist at the point in time of
the sending of the signal. If this is not the case, the interpretation of the system
description results in a dynamic error, i.e. the future behaviour of the system is
undefined. Identity of a processEvery process instance has a unique identity. The identity is not determined by the user, but is rather created by some abstract SDL machine during the creation of a process. This SDL machine guarantees that every process gets a unique identity. The identity of a process instance is not identical to the process name, because there may be many instances of a given process definition with a certain name. Identities are of type PId, which is a predefined data type in SDL (see also 'Data type concepts'). For every process there are four predefined expressions of PId:
For all processes that are created when the system is created, the PARENT expression has the value Null. For all processes the SENDER and OFFSPRING expressions have the initial value Null These expressions in the same way as other expressions, and the user of SDL can store their values in variables of the type PId, which can also be used to specify the destination in an output. Explicit identitiesTo specify a destination identity explicitly, the TO construct is used. The keyword TO is used in an output, and it is followed by an expression containing the address of the destination process. Figure 26 shows some examples. The expression can be a predefined one (SELF, SENDER, OFFSPRING, PARENT), or a variable of type Pid defined by the user of SDL (e.g. Dest). Figure 26: Examples of explicit identities Implicit identitiesThe explicit specification of a destination identity is not necessary if the destination is uniquely defined by the system structure (i.e. there is only one process in the system and its environment that can receive the signal). Figure 27 shows an example. The block Example contains two process definitions P1 and P2 and there one process instance of each definition. P1 can send signals over signal routes Sr1 and Sr2. The signal B can only be sent on signal route Sr1. Therefore, the destination process for the output of B in P1 need not be specified explicitly. This is the simplest way of using implicit identities. It is in fact the only alternative to establish contact between different blocks (hand-shaking), since, initially, processes in different: blocks do not know the identities of each other. Figure 27: Example of implicit identities and the use of VIA construct Identifying the destination by naming a pathIn some cases neither is the explicit identity of a destination process known nor is the destination process uniquely defined by the system structure. In this case a unique destination process may be specified by naming a communication path (a signal route or channel) on which the signal should be sent. This can be done by using the VIA construct Figure 27 shows an example of the use of the VIA construct. The signal A can be transported by signal routes Sr1 and Sr2. Implicit identification alone is not possible because the destination of A is not determined by the system structure. With VIA followed by a signal route name, the destination can be uniquely specified, as is done in the example. Note that the VIA construct can also be used in combination with explicit identification (e.g. for the purpose of dynamic checking). |
Contact the webmaster with
questions or comments about this web site. |