More comments on “Distributed termination detection algorithm for distributed computations” [1,2]

More comments on “Distributed termination detection algorithm for distributed computations” [1,2]

Information Processing North-Holland Letters 29 (1988) 53-55 15 September 1988 Letter to the Editor MORE COMMENTS FOR DISTRIBUTED ON “DISTRIBUTED...

184KB Sizes 0 Downloads 57 Views

Information Processing North-Holland

Letters 29 (1988) 53-55

15 September

1988

Letter to the Editor MORE COMMENTS FOR DISTRIBUTED

ON “DISTRIBUTED TERMINATION COMPUTATIONS” [1,2]

Dear Sir, It has been asserted by Tan et al. [2] that the algorithm presented by us in [l] is incorrect and detects false termination. A counterexample of a network consisting of a ring of eight processes has been given to prove this. This counterexample assumes the probe-message of A just before the process E, when G enters into basic communication with F, F with D, and D with C, and then eventually A concludes termination even though the process C is still active. This implies that there is a certain amount of delay in handling the probe-messages whereas our reported algorithm does not assume any such delays. Further, the counterexample assumes that when a process enters into basic communication with some other process, only the latter process records the state of the former as active. This is not at all intended in our paper [l]. In fact, it is explicitly stated there that whenever basic communication takes place between the two processes, the sender process, too, records the state of the receiver as active. (“Whenever a process sends a message to a neighbouring node, it records the state of that neighbouring node as active”-see [l, p. 312, right column, line 6 from above].) All sender and receiver processes are being treated as neighbours as implicitly reflected in the algorithm. Under the circumstances, the counterexample cannot be used to verify the algorithm presented in our paper [l]. Let us examine the counterexample. Assume that G enters into basic communication with F in the following two situations: (1) When the probe-message of A reaches just before E, G initiates a message for having basic communication with F. (2) When the probe-message of A reaches just before E, F receives basic communication from G. 0020-0190/88/$3.50

0 1988, Elsevier Science Publishers

DETECTION

ALGORITHM

The second situation obviously involves less communication delays and we therefore examine it further. As per the counterexample, F enters into basic communication with D, and D with C. As a result, F, D, and C record the states of respectively G, F, and D as active. When G becomes passive, it cannot issue any I-am-passive message to F as it has not kept the record of the process F with which it did basic communication. The state of G remains active in F and would result in purging the probe-message of A. In fact, this would lead to a deadlock situation. In the presented algorithm, it is intended that when G enters into basic communication with F, F with D, and D with C, then the processes G, F, D, and C would record the states of respectively F, (G, D), (C, F), and D as active. The states would be turned to passive only when G, F, D, and C receive I-am-passive messages from F, G, and D, C and F, and D respectively. In case the delay in transmitting the probe-message of A from E to F is such that, before the probe-message reaches F, F would have already received the I-am-passive messages from both G and D, then the counterexample is valid. However, to circumvent the above situation, we can modify our algorithm [l], where the information about the state of neighbours is updated through control communication, around a ring, in the following manner: whenever a process pi becomes passive, it constructs a list depending upon process identification of its neighbours and sends an I-am-passive control message (carrying the list) to its successor process. The process, say pj (i # j), which receives this message, checks whether it belongs to the neighbours of p,. If not, the message is forwarded further; otherwise, the process pj records the state of pi as passive or keeps it passive if it was already passive. The process

B.V. (North-Holland)

53

Volume

29, Number

1

INFORMATION

PROCESSING

identification p, is removed from the list and a further check is made about the contents of the list. If the list is found to be empty, the I-am-passive message is purged; otherwise, it is forwarded to the successor process. Further, a process which purges the I-am-passive control message issues a control probe-mes1.

LETTERS

15 September

1988

sage only when it discovers that it is itself and that all its neighbours are passive. The modified algorithm consists of four parts. Part 3 is the same as that of our algorithm in [l] and is omitted. Parts 1, 2, and 4 for a process p, (1 < i < n) are fully described below.

Upon becoming passive :

begin state( pi) := passive; for each p E { neighbours of pi } augment list( pi) by p; / * initially list( p,) is empty send I-am-passive( pi, list( p,)) to successor( p,); clear list( pi)

*/

end

2.

Upon receiving

an I-am-passive(

pk, list( pk))

from pk (i f k):

begin kpm( pi) := false; if pi E { neighbours

of pk } then

begin state,( pk) := passive; remove pi from Iist( pk); if list( pk) empty then begin purge I-am-passive( pk, list( pk)); if state;( pj) = passive for all pj E {neighbours and state( pi) = passive

of pi }

then

begin kpm( pi) := true; seq(pi):=

seq(p,)

+ 1;

/ + seq( p,) + sequence

number

with

initial

value 0 */ seqdm( pi) := seq( pi); send a probe-message to successor( p,) / * probe-messages carry the sequence end end else forward I-am-passive( end

pk, list( pk))

to successor(

else forward I-am-passive( end 54

pk, list( pk)) to successor(

pi)

number

pi)

seqdm as well * /

Volume

29. Number

4.

1

INFORMATION

Upon receiving a probe-message

PROCESSING

LETTERS

15 September

1988

initiated by pi itself:

hegin if kpm( p, ) = frue and seq( p, ) = seqdm( p, ) / * seqdm( p,) associated with probe-message then enter in termination

of p, * /

phase

else purge the probe-message end R.K. ARORA and M.N. GUFTA Department of Computer Science and Engineering, India Institute of Technology, New Delhi 110016, India

References [l] R.K. Arora, S.P. Rana and M.N. Gupta, Distributed termination detection algorithm for distributed computations, Inform. Process. Left. 22 (6) (1986) 311-314. [2] R.B. Tan, G. Tel and J. Van Leeuwen, Comments on

“Distributed termination detection algorithm for distributed computations” (Letter to rhe Editor), Inform Process. Lerr. 23 (3) (1986) 163. Communicated by W.L.. Van der Poe1 Received 28 January 1987 Revised 26 May I987

55