MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Implementation of Election Algorithm of Distributed Systems in Client-Server Architecture
1. Presented By –
Mushfekur Rahman
Implementation of
Election Algorithm of
Distributed Systems in
Client-Server Architecture
2. 2
Distributed Systems
• Distributed systems are networked
computers or processes operating with same
resources generally mentioned as CRITICAL
SECTION.
• Critical Section can be any shared memory or
any shared data structure which can be
needed to update by each process.
3. 3
Distributed Algorithms
• Distributed Algorithms are used to solve
some standard problems in Distributed
Systems such as mutual exclusion,
resource allocation, distributed search
and so on.
• Our project deals with only Mutual
Exclusion Problem.
4. 4
Algorithms
• Here we will be describing about two common
algorithms to achieve mutual exclusion in
Distributed Systems.
1. Centralized Algorithm
2. Token Ring Algorithm
5. 5
Centralized Algorithm …
• One process elected as coordinator
• Others send request to access into the
Critical Section
1. Request resource
2. Wait for response
3. Receive grant
4. access resource
5. Release resource
6. 6
Centralized Algorithm …
• If another process claimed resource:
- Coordinator does not reply until release
- Maintain queue
•Service requests in FIFO order
7. 7
Benefits
• All requests processed in order since there
is no priority so FIFO order is maintained
• Easy to implement, understand and verify
8. 8
Token Ring Algorithm
• Assume known group of processes
- Some ordering can be imposed on group
- Construct logical ring in software
- Process communicates with neighbor
9. 9
Token Ring Algorithm …
• Initialization
-Process 0 gets token for resource R
• Token circulates around ring
- From Pi to P(i+1)mod N
• When process acquires token
- Checks to see if it needs to enter
critical section
- If no, send ring to neighbor
- If yes, access resource
•Hold token until done
10. • Only one process at a time has token
– Mutual exclusion guaranteed
• Order well-defined
– Starvation cannot occur
• If token is lost (e.g. process died)
– It will have to be regenerated
• Does not guarantee FIFO order
– sometimes this is undesirable
10
Token Ring Algorithm …