Distributed Computing
Distributed Computing
**Critical Section**: A critical section refers to the parts of a program that access shared
resources. These sections must not be executed by more than one process or thread at the same
time. Mutual exclusion is used to protect these critical sections to ensure system stability and
integrity.
**Selection of Victims**: This term often relates to scenarios like deadlock resolution. When a
system detects a deadlock, it must choose one or more “victim” processes to terminate or roll
back to break the deadlock. The selection is typically based on factors like process priority,
resource usage, and the amount of processing done.
**Election Algorithms**: These algorithms are used in distributed systems to coordinate actions
among a set of processes, such as choosing a new coordinator or leader when the current one
fails. The five main types are:
1. **Bully Algorithm**: The process with the highest priority takes over as the leader if the
current leader fails.
2. **Ring Algorithm**: Processes are arranged in a logical ring, and election messages circulate
until a leader is elected.
3. **Berkeley Algorithm**: Used for time synchronization among distributed systems, selecting
a time reference server.
4. **Raft Algorithm**: Ensures a consistent log across distributed systems, electing a leader to
manage this log.
5. **Paxos Algorithm**: A consensus algorithm that elects a leader to propose values and decide
on a single value among distributed processes.
**Logical Clocks**: These are mechanisms for ordering events in a distributed system, where
physical clocks cannot be relied upon for accurate timekeeping due to differences in clock rates
and network delays. Logical clocks, such as Lamport timestamps, help ensure that all
components of a distributed system can agree on the order of events, which is critical for
consistency and coordination.
Logical clocks are vital in distributed systems for understanding causality, resolving conflicts,
and ensuring that distributed operations can be correctly ordered and applied, maintaining the
system’s overall integrity and consistency.