Download Introducing hierarchy, abstraction, namespaces and relays

Transcript
processes, similar to process C in the first example. All communication between
processes in subsystem B and its environment are rerouted12 through process B,
effectively isolating subsystem B from the rest of the system. Isolating (a part
of) a system and controlling all external interactions is called sandboxing. Process B will monitor all processes in subsystem B and restart them if needed.
This way, if any of the processes in subsystem B crashes, process B will correct
the situation. The rest of the system is completely unaware of this.
7.9
Analysis of matching communication actions
It has always been possible to check if for every snd-msg action there is a
corresponding rec-msg action and vice versa. In the current ToolBus system
every process may communicate with every other process. Therefore, in the
analysis, for each process we have to check all other processes. In the new
ToolBus, because of the communication restriction, the analysis becomes much
more local. Obviously, we also have relays, which make the analysis a bit more
complicated, but still we don’t have to check all other processes for every process
as in the current situation. The ToolBus could (optionally) give warnings for
all messages that don’t have a counterpart, making it possible to detect (some)
deadlocks more easily. There are two methods for performing such analysis,
dynamic checking and static checking.
7.9.1
Dynamic checking
Dynamic checking (at runtime) is quite difficult as some processes may not yet
have been instantiated or may already have terminated. However, it is possible
to check if a snd-msg action has more than one rec-msg partner in the current
runtime configuration of the system. Such a situation indicates that the message
may be received by either of the rec-msg actions and there is no way to tell which
one. This could lead to unwanted behavior. Therefore, the ToolBus could give
a runtime warning if such situations occur. The reverse situation, a rec-msg
with multiple corresponding snd-msg actions is no problem, since for instance
an error component could receive error messages from multiple sources.
7.9.2
Static checking
Let’s take a look at Figure 19. Message m3 sent by process Main in namespace x/z, matches message m3 received in namespace z by process B, which is
instantiated by process Main in namespace x.
In general, we could check for each message and note that is sent or received,
whether there is a matching action, possibly via relays. It is also possible to
check if there are multiple rec-msg actions for snd-msg actions, like with the
dynamic check. However, if we check it statically, there is no guarantee that the
12 This
is also a good example of why, even though we have relays, chaining can still be
useful.
59