Write A Report About Distributed Process Synchronization
Write A Report About Distributed Process Synchronization
Introduction
Distributed process synchronization is the connection and management of several functioning processes
in a distributed system. In a distributed system, processes are often running on different machines or
nodes and they need to get synchronized with each other so that their actions have correctness and
consistency.
Distributed process synchronization aims to prevent conflicts and ensure that processes access shared
resources in an exclusive manner. This prevents problems such as race conditions, data inconsistencies
and deadlock situations.
Importance
Synchronization is important between distributed systems to achieve various things such as:
Consistency
Simultaneous Access
Reliability
Performance optimization
Challenges
Network Latency:
Delays in network communication impacts the ordering events and synchronization protocols.
Node Failures:
If the synchronization does not occur properly, node failures can disrupt the entire process resulting in
inconsistencies that may result into data loss unless handled well. Besides, nodes that fail to synchronize
add one more layer of complexity.
Techniques
In order to obtain synchronization, a number of techniques and algorithms are applied. These include
mutual exclusion algorithms where the processes take turns in accessing shared resources, and message
passing where processors communicate and coordinate their actions by exchanging messages. Following
are the techniques that are used to achieve synchronization:
Centralized Synchronization:
Coordinator-Based Approach: In a centered model, one designated coordinator node is responsible for
the synchronization operation. Processes communicate with the coordinator to ask for access to shared
resources or entering into critical sections.
Token-Based Algorithms: A token is sent between processes in a determined sequence, and the process
that has this token can access to it critical section. This approach ensures that no more than one process
can enter the critical section. For instance, the Ricart-Agrawala algorithm for mutual exclusion.
Leader Election: 0 elect a leader, and this one has the responsibility of managing synchronization
processes. Leader selection algorithms make a node the focal point hence reducing contention.
Ricart-Agrawala Algorithm:
In the Ricart-Agrawala algorithm, processes interact through messages for requesting access to a critical
section. The algorithm guarantees that the critical section can be entered by only one process at a time
offering mutual exclusion. Use a coordinator to control the permission of entering into critical section is
one key idea.
Maekawa Algorithm:
The Maekawa algorithm gives a speedy and safe system to have mutual exclusion in distributed
systems. The use of quorums is the right compromise between message simplification and reliability
which makes this algorithm applicable in many practical applications.
Decentralized Synchronization:
Lamport clocks perform well doing partially ordered events in distributed system. Logical timestamps
allow for proper synchronization of processes and distinction between causality events.
Compared to such an obvious thought as the same log clocks, vector clock reveals a new plain by
assigning process for every set of timestamps. This improved method allows to sequence the events
more accurately and notice causality relationships.
Example of decentralized synchronization are vector clocks. Vector Clocks allows processes to
understand the value of events relative to one another and establish causality relationships without a
central coordinator. They provide a more dynamic form of work in decentralized systems where the
processes need to coordinate their activities without an obligatory connection with some central control
point.
Hybrid Approaches:
Quorum-Based Systems:
Distributed databases achieve consistency and coordination through the use of quorums. A quorum is
the set of nodes that are required to agree on an operation prior for said operation becomes valid.
Quorum-based systems solve the tradeoff between consistency and availability.
Global snapshots capturing the state of a system at any given point in time could be used by distributed
systems. Coordinated global snapshots can have the same checkpoints and recovery points for all.
This hybrid approach provides a balance between decentralizing the decision (reads from each node)
and the degree of centralization for write operations.
It provides an interface between dynamic and high availability, enabling the system to handle read and
write operations more efficiently.
2PC is used to atomize transactions in a distributed database. It’s about the facilitator and the
participants. The administrator sends a preparation message, and if all participants agree, a commit
message. If a participant disagrees, a rollback is initiated.
Three-Phase Commitment (3PC): 3PC is an extension of 2PC that addresses some of its limitations, such
as blocking under certain failure conditions. Some additional steps have been introduced to improve
fault tolerance.
Asynchronous Message Passing enables nodes to continue operations without waiting for a response,
improving system concurrency.
Two-sided commands ensure that not all nodes are committed or none are committed, and maintain the
atomicity and consistency of distributed transactions.
Clockwork:
Network Time Protocol (NTP): NTP is used to synchronize the clocks of distributed nodes. It enables a
consistent sense of timing, which is essential to keep distributed systems organized.