Parallel and Distributed Algorithm-3

1.Deadlock:

A deadlock occurs if a process is forced to wait forever either:

– on some input (communication deadlock)

– or on some resource (resource deadlock)

2.Detecting the deadlock means finding an established cycle dependency in the system.

3. Wait-for Graphs:Shows the dependency between processes and resources.(A node is either a process or a resource)

4.N-out-of-M request:a process needs at least N units of something that can be provided by a group of M processes.

5.Resource deadlock M-out-of-M: one process needs to wait for M processes to be locked in order to proceed with a database transaction.

6.Communication deadlock 1-out-of-M: one process is waiting for one message that needs to come from a group of M processes.

7.Only non-blocked nodes in the wait-for graphs can issue requests.

If a non-blocked node u issues a N-out-of-M request which translates into the node u sending M requests, then it becomes blocked until N such requests are granted.

Every time some node v grants such a request, the arc uv is removed from the wait-for graph .When N requests have been granted (and N arcs have been removed), u becomes unblocked and informs the other M-N nodes to ignore its request, the rest of M-N arcs are also removed.

8. Bracha-Toueg Algorithm:---------------------Deadlock Detection

A snapshot of the wait-for graph of the distributed system executing the basic algorithm that possibly caused the suspected deadlock.

A process that suspects that is deadlocked starts a Lai-Yang snapshot also tagging its control messages with its ID.

Other processes may initiate the Lai-Yang algorithm, so by tagging control messages there is a clear distinction among all the initiators.

Each node u takes a local snapshot to determine the requests it has sent or received that have not yet been granted or purged, taking into account the grant or purged messages on the incoming channels (the local states of the incoming channels).

Then node u computes two sets:

– (Out)u: the nodes to which u to has sent a request and that request was not yet granted or purged.

– (In)u: the nodes from which u has received a request and the request was not granted by u neither purged by the requester.

Once node u receives all the snapshots, it can do static analysis on the wait-for graph to determine deadlock(s) by deciding for each node whether it is blocked or not.

Let requestsu be the number of grants node u requires in the wait-for graph to become unblocked.

– When requestsu is or becomes 0, u sends grant messages to all nodes in Inu.

– When u receives a grant message, requestsu ← requestsu −1.

– If after all other nodes in the system grant all the request they can and still requestsu > 0 at the initiator, then node u is deadlocked in the basic algorithm.

9.Termination Detection:

A process, executing any basic algorithm can be in either passive or active state:

Termination detection techniques:

– Maintaining trees of active processes (Dijkstra-Sholten alg., Shavit-Francez alg.)

– Dividing a fixed weight over the active processes and basic messages (Weight-throwing alg.)

– Waves tagged with logical clock values (Rana’s alg.)

– Token-based traversal (Safra’s alg.)

猜你喜欢

转载自blog.csdn.net/francislucien2017/article/details/78458228