Page 40 -
P. 40

2  The Language: Rationale and Fundamentals                      27
                           Table 2.1 Split construct–pattern mapping
                                              Split construct  Pattern
                                              AND-split        Parallel split
                                              XOR-split        Exclusive choice
                                                               Deferred choice
                                              OR-split         Multichoice
                                              Thread-split     Thread split



                           where after the pour tea task, the execution thread diverges into multiple concurrent
                           threads causing the add sugarcube task to execute several times.
                              Each of these situations can be mapped to a specific pattern that precisely
                           describes the desired split behavior as shown in Table 2.1. In the case of the XOR-
                           split, there are two possible ways in which it can be implemented and consequently
                           there are two patterns that describe these alternatives.
                              The operation of the XOR-split can be realized in two distinct ways depending on
                           whether the process itself contains sufficient information to make the required rout-
                           ing decision when the split construct is reached or whether additional external input
                           is required to make the decision. If we consider the example shown in Fig. 2.2b, two
                           possible courses of action are possible when the XOR-split construct is reached and
                           these are recognized by two specific patterns:
                             Exclusive Choice, where the process contains sufficient information to determine
                              where to route the thread of control when the decision construct is reached and
                              does so automatically. In the example above, this would immediately result in
                              either the add milk or add lemon task being initiated when the XOR-split was
                              reached.
                             Deferred Choice, where the decision is not made automatically from within the
                              context of the process but is deferred to an entity in the operational environment.
                              In the context of the example above, the process would halt at the XOR-split
                              pending this decision, which would be signaled by either the add milk or the add
                              lemon task being initiated.
                           The branching patterns provide various mechanisms for diverging the thread of con-
                           trol within a process. The following group of control-flow patterns provide various
                           mechanisms for synchronizing threads of control within a process.



                           Synchronization Patterns
                           Synchronization patterns are the logical counterpart to the branching patterns. They
                           identify various types of synchronization and merging behaviors that are generally
                           associated with join constructs in a process. Four distinct types of join are commonly
                           utilized:
                             The AND-join, which synchronizes the thread of control in multiple branches
                              and merges them into a single execution thread in an outgoing branch.
   35   36   37   38   39   40   41   42   43   44   45