• No results found

A general computing model and termination detection

State of the art in Termination detection in distributed Systems

Definition 1. Termination detection

2.3 A general computing model and termination detection

[37] introduces a general distributed computation model, termination definitions, some terminology and predicates relating to termination detection and finally algorithms for the given termination definitions.

So far the assumption has been that the reception of a single message is enough to activate a passive process. In the general model introduced by [37], a passive process does not necessarily become active on the receipt of a message, instead a condition of activation of a passive process is more general and a passive process requires a set of messages to become active. This requirement is defined over a setDSi of processes from which a passive processPi is expecting messages. The setDSi associated with a passive processPi is called a dependent set ofPi. A passive process becomes active only when its activation condition is fulfilled.

The Communication model: A distributed application program (whose execution is traditionally called the underlying computation) is composed of a finite set P of processes Pi, i = 1, .., n, interconnected by unidirectional transmission channels; the channel Cij links the sender Pi to the receiver Pj. Processes communicate only by exchanging messages through channels; there is neither common memory nor a global clock, [37].

Communication is asynchronous in the following sense:

1. A sender sends a message to a channel (which then has responsibility for its delivery) and then the sender immediately continues its own execution;

2. Channels do not necessarily obey the FIFO (first in first out) rule, but they are reliable (no loss, no corruption, no duplication, no spurious messages);

3. Channel transfers (carries) a message to its destination process, the receiver puts it in its local buffer: the message has then arrived. The arrived message can then be consumed provided that its receiver has been activated, i.e. when the request of receiver has been fulfilled;

4. The transfer delay (time elapsed between sending and arrival of a message) is finite but unpredictable.

The process model: in addition to the discussed process model, there is a further requirement expressed by an activation condition (see below) defined over the set DSi of processes from which a passive process Pi is expecting messages [37]. The set DSi associated with a passive process Piis called dependent set of Pi. A passive process can only become active when its activation condition is fulfilled. If such an activation is re-alized as soon as the activation condition is fulfilled ( i.e. without any additional delay w.r.t the activation condition fulfillment), this constitutes instantaneous activation.

A passive process that has terminated its computation is said to be individually termi-nated, its dependent set is empty and therefore it can never be activated [37].

Request models: Formulation of activation conditions strictly depends on the re-quest model considered.

1. AND model:- In this model a passive process Pi can be activated when a mes-sage from every process Pjbelonging to DSihas arrived. It models receive state-ment that is atomic on several messages [37].

2. OR model:- In the OR model, a passive process Pi can be activated when a message from any process Pj belonging to DSi has arrived. It models classical non-deterministic receive constructs [37].

3. Other more complex models such as OR-AND, Basic k out of n and Disjunctive k out of n models are presented in [37].

In order to abstract the activation condition of a passive process Pi, a predicate fulfilledA can be considered, where A is a subset of P, the set of all processes. Predicate fulfilledA is true if and only if messages arrived (not yet consumed) from all processes belonging to the set A are sufficient to activate process Pj. The following monotonicity property is valid: if X⊆ Y and fulfilledX is true, then fulfilledYis also true [37].

Termination definitions: The following notations are introduced to formally define terminations of distributed computations. The notation used here is introduced in [37].

1. passivei: true iff Piis passive;

2. empty (j, i) : true iff all messages sent by Pjto Pihave arrived at Pi; the messages not yet consumed by Pi are in its local buffer;

3. arri (j) : true iff a message from Pj to Pi has arrived and has not yet been con-sumed by Pi;

4. arri = { processes Pj such that arri (j) };

5. nei = {processes Pj such that¬ empty (j, i) }.

Dynamic termination: The set P of processes is said to be dynamically terminated at some time if and only if the predicate Dterm is true at this moment, where:

Dterm≡ ∀Pi∈ P: passivei ∧ ¬fulfilledi ( arri ∪ nei ) [37].

This notion of termination means that no more activity is possible from processes, though messages of the underlying computation can still be in transit (represented by possibly non empty sets nei in the predicate ). This definition is interesting for early detection of termination as it allows to conclude a computation is terminated even if some of its messages have not yet arrived [37]. It can be shown that once true, the predicate Dterm remains true, thus dynamic termination is a stable property [37].

Static Termination The setP of processes is said to be statically terminated at some time if and only if the following predicate is true at this moment:

Sterm≡ ∀Pi ∈ P: passivei∧ (nei =∅) ∧ ¬fulfilledi( arri) [37].

For this predicate to be true, channels must be empty and processes cannot be acti-vated. Thus this definition is based on the state of both channels and processes. When compared to Dterm, the predicate Sterm correspond to "late" detection as, additionally, channels must be empty.

[37] discusses a number of theorems related to static termination and outlines their proofs, for example Dterm7→ Sterm (leads-to relation over the predicates).

Given this model, static and dynamic termination detection can be discussed, this dis-cussion is given in Appendix I, page 350 with some illustrations.

2.4 A contemporary taxonomy for distributed termination