Synchronization in Distributed Systems
Outline
Definition
Time and Global State Introduction
� CLOCK SYNCHRONIZATION
…
MUTUAL EXCLUSION
…
Issues in Recovery from Deadlock:
i) Selection of Victims
Based on two major factors
1. Minimization of recovery cost - those processes should be selected as victims whose termination / rollback will incur the minimum recovery cost.
Some of the factors that may be considered for this purpose are
a) The priority of the processes; (BANK- P1-opening an account, P2-checking balance, P3-depositing)
b) The nature of the processes, such as interactive or batch and possibility of return with no ill effects;
c) The number and types of resources held by the processes;
d) The length of service already received and the expected length of service further needed by the processes; and
e) The total number of processes that will be affected.
2. Prevention of starvation:
If a system only aims at minimization of recovery cost, it may happen that the same process (probably because its priority is very low) is repeatedly selected as a victim and may never complete.
ii)Use of Transaction Mechanism:
ELECTION ALGORITHMS
Assumptions
1. Bully Algorithm:
The Bully election algorithm �
a) Process 4 holds an election.
b) Process 5 and 6 respond, telling 4 to stop.
c) Now 5 and 6 each hold an election.
d) Process 6 tells 5 to stop.
e) Process 6 wins and tells everyone.
ii) Ring Algorithm:
Centralized Algorithm
b) Process 2 then asks permission to enter the same critical region. The coordinator does not reply.
c) When process 1 exits the critical region, it tells the coordinator, when then replies to process 2.
Mutual Exclusion Algorithms
Other Algorithms for Mutual exclusion
Distributed Debugging
Common failure in Distributed Systems
Logging
Monitoring
Distributed Tracing
Multicast Communication
Importance Of Group Communication
Consensus in Distributed Systems
Importance of Distributed Consensus in Distributed Systems�