Concurrency Theory: Lecture 19, 3 April 2018 --------------------------------------------- Message Sequence Charts Can represent the messages exchanged by a set of agents as a timing diagram. Each process has a vertical time line, time flows top to bottom. Message are arrows between time lines. 1 2 3 | m | | |----->| | | | | | | m' | | |----->| | | | | | m" | |<-----+------| | | | Can record each arrow as a pair of (send,receive) events. Events inherit a partial order generated by the following minimal edges: - Local total order along each agent. Agents are sequential, so each pair of consecutive events along a timeline is linearly ordered. - Each (send,receive) pair for a given message is ordered As usual, we can represent an MSC by its linearizations over the alphabet i!j(m) and i?j(m). We typically assume that all channels are FIFO. This allows us to reconstruct the MSC uniquely from any one of its linearizations. A language of MSCs is a set of MSCs. Alternatively, it is a word language consisting of all the linearizations of the MSCs in the set. An MSC language is regular if its corresponding word language of linearizations is regular. Message Sequence Graphs A directed graph in which each node is labelled by an MSC. If we designate an initial node and a set of final nodes, each accepting path from an initial node to one of the final nodes generates an MSC by concatenating the node labels. Call the resulting set of MSCs the language of the MSG. The language of an MSG can be non-regular --- for instance, the producer consumer system is a trivial one node MSG with a self loop and has unbounded buffers. Associate with MSC a communication graph: nodes are processes, there is a directed edge from i to j if there is a message from i to j in the MSC. An MSG is globally synchronized if for every loop in the MSG, the communication graph of the resulting MSG consists of disjoint strongly connected components (including possibly trivial sccs consisting of single nodes that do not participate in the MSC). Lemma: If an MSG is global synchronized, then there is a uniform upper bound on buffers for all MSCs in the language of the MSG. Unfortunately, this does not guarantee regularity. MSGs provide global control across the processes. Can set up a loop in which two disjoint pairs of processes {p,q} and {r,s} exchange messages an equal number of times. Resulting language is context free. An MSG is locally synchronized if for every loop in the MSG, the communication graph of the resulting MSG consists of a *single* strongly connected components, plus possibly trivial sccs consisting of single nodes that do not participate in the MSC. Lemma: If an MSG is locally synchronized, its MSC language is regular. This is sufficient, but not necessary. We can modify the loop example above with a self loop at each node of the MSG. The resulting language will be regular but the MSG is not locally synchronized. ======================================================================