0% found this document useful (0 votes)
43 views16 pages

Coordination: CE32204 - Distributed System Presented By: Eka Stephani Sinambela Institut Teknologi Del

This document discusses coordination in distributed systems. It explains that coordination aims to manage interactions and dependencies between processes. Logical clocks are introduced as a way to maintain a global view of event ordering without a shared physical clock. Vector clocks are also discussed as they can capture potential causality between concurrent message exchanges. Finally, permission-based mutual exclusion algorithms are summarized, including both centralized and distributed approaches to coordinating exclusive access to shared resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views16 pages

Coordination: CE32204 - Distributed System Presented By: Eka Stephani Sinambela Institut Teknologi Del

This document discusses coordination in distributed systems. It explains that coordination aims to manage interactions and dependencies between processes. Logical clocks are introduced as a way to maintain a global view of event ordering without a shared physical clock. Vector clocks are also discussed as they can capture potential causality between concurrent message exchanges. Finally, permission-based mutual exclusion algorithms are summarized, including both centralized and distributed approaches to coordinating exclusive access to shared resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Coordination

CE32204– Distributed System


Presented by: Eka Stephani Sinambela
Institut Teknologi Del
Introduction
Why coordination is important?

◉ Concentrate on how processes can synchronize and coordinate their actions.

◉ Example:
○ Multiple processes do not simultaneously access a shared such as a file, but
instead cooperate in granting each other temporary exclusive access.
○ Multiple processes may sometimes need to agree on the ordering events, such as
whether message m1 from process P was sent before or after message m2 from
process Q.
Why coordination is important?

◉ Synchronization and coordination are two closely related phenomena.


○ Process synchronization  one process waits for another complete its operation.
○ data synchronization  to ensure that two sets of data are the same.
○ Coordination  the goal is to manage the interactions and dependencies between
activities in a distributed system.

◉ Issue of synchronization
○ actual time
○ Synchronization in which only relative ordering matters rather than ordering in absolute
time
Logical Clock
The Happened-before relationship

◉ What usually matters is not that all processes agree on exactly what time it is, but
they that they agree on the order in which events occur. Requires a notion of
ordering.

◉ The happened-before relation


○ If a and b are two events in the same process, and a comes before b, then a  b.
○ If a is the sending of a message, and b is the receipt of that message, then a  b.
○ If a  b and b  c, then a  c
Logical Clocks

◉ Problem
○ How do we maintain a global view on the system’s behavior that is consistent with
the happened-before relation?

◉ Attach a timestamp C(e) to each event e, satisfying the following properties:


○ P1 if a and b are two events in the same process, and a  b, then we demand that C(a) < C(b).
○ P2 if a corresponds to sending a message m, and b to the receipt of that message, then also C(a) <
C(b).

◉ Problem
○ How to attach a timestamp to an event when there’s no global clock  maintain a consistent set of
logical clocks, one per process.
Logical Clocks

◉ Solution
○ Each process Pi maintains a local counter Ci and adjust this counter
■ For each new event that takes place within Pi, Ci is incremented by 1.
■ Each time a message m is sent by process Pi, the message receives a timestamp ts(m) = Ci.
■ Whenever a message m is received by a process Pj, Pj adjusts its local counter Cj to max{Cj,
ts(m)}; then executes step 1 before passing m to the application.
○ Property P1 is satisfied by (1); Property P2 by (2) and (3).
Logical Clocks

◉ Example
○ Consider three processes with event counters operating at different rates
Logical Clocks

◉ Where implemented
○ Adjustments implemented in middleware
Vector Clocks

◉ Observation
○ Lamport’s clocks do not guarantee that if C(a) < C(b) that a causally preceded b.
○ Concurrent message transmission using logical clocks.
○ Observation
■ Event a: m1 is received at T = 16
■ Event b: m2 is sent at T = 20

◉ We cannot conclude that a causally precedes b


Vector Clocks

◉ Example:
○ Capturing potential causality when exchanging messages

○ Analysis
Mutual Exclusion
◉ Problem
○ A number of processes in a distributed system want exclusive access to
some resource (simultaneously access the same resources).
◉ Basic solution:
○ Permission-based: A process wanting to enter its critical section, or access a
resource, needs permission from other processes.
■ Centralized algorithm
■ Distributed algorithm
Permission-based centralized
◉ Simply use coordinator

◉ (a) Process P1 asks the coordinator for permission to access a shared


resource. Permission is granted.
◉ (b) Process P2 then asks permission to access the same resource. The
coordinator does not reply.
◉ (c) When P1 releases the resource, it tells the coordinator, which then replies
to P2
Permission-based distributed
◉ Mutual Exclusion Ricart & Agrawala
○ Return a response to a request only when:
■ The receiving process has no interest in the shared resource; or
■ The receiving process is waiting for the resource, but has lower priority (known through
comparison of timestamps)

◉ Example with three process

○ (a) Two processes want to access a shared resource at the same moment.
○ (b) P0 has the lowest timestamp so it wins.
○ (c) When process P0 is done, it sends OK also, so P2 can now go ahead.
Thanks!

You might also like