[SDL Forum Society - Logo] Tutorial on SDL-88
Belina, Hogrefe (edits Reed)

4.2 Identifying Processes

Back Home Up

For any signal sent by a process there must be one and only one destination. This destination can be specified

explicitly, by specifying the identity of the destination process in the output, or
implicitly, by omitting the address of the destination process in the output

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.
Note: In SDL-92 and SDL-2000 this is not an error and the signal is just discarded in the output. However, it would be expected that a good validation tool would report the loss of the signal as a potential problem. Moreover, if there is more than one process that can be reached with the signal in an output, the destination is chosen on an arbitrary basis.

Identity of a process

Every 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:

SELF, giving the identity of the process instance itself
SENDER, giving the identity of the process instance from which the last consumed signal has been sent;
OFFSPRING, giving the identity of the process instance that has been most recently created by the process; and
PARENT, giving the address of the creating process.

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 identities

To 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).

wpe8.gif (2998 bytes)

Figure 26: Examples of explicit identities

Implicit identities

The 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.

wpe9.gif (4340 bytes)

wpeB.gif (3047 bytes)

Figure 27: Example of implicit identities and the use of VIA construct

Identifying the destination by naming a path

In 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).

Back Home Up

Contact the webmaster with questions or comments about this web site.
Copyright 1997-May, 2013 SDL Forum Society