A12_DistMutex_Ch6 - Synchronization in Distributed Systems...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Synchronization in Distributed Systems Chapter 6.3 Introduction • Semaphores require processes to access a shared variable. Other synchronization mechanisms may also be based on shared memory (monitors, for example) • In distributed systems, interprocess communication is via messages (or RPC ) so mutual exclusion mechanisms must be based on this approach. Logical clocks are an example. Message Passing • Processes may use broadcast (transmit to any interested process) or multicast (transmit to all members of a specific group) message passing. • Blocking send/receive protocols are often used, because it can be guaranteed that the sender and receiver are synchronized when the message is exchanged – Sender will not continue until message has reached receiver Example • Process 1 at Site 1 write to file Send (p2, message) If the sender wants to rendezvous with receiver, the Send can also be blocking – or a blocking Receive can be executed immediately after the send. • Process 2 at Site 2 Receive * (p1, message) read from file Note similarity to solution that used semaphore to force one process to wait for another. * blocking Distributed Mutual Exclusion Characterized • Processes communicate only through messages – no shared memory or clock. • Processes must expect unpredictable message delays. • Processes coordinate access to shared resources (printer, file, etc.) that should only be used in a mutually exclusive manner. Example: Overlapped Access to Shared File • Airline reservation systems maintain records of available seats. • Suppose two people buy the same seat, because each checks and finds the seat available, then each buys the seat. • Overlapped accesses generate different results than serial accesses – race condition . Desirable Characteristics for Distributed Mutex Solutions (1) no deadlocks – no set of sites should be permanently blocked, waiting for messages from other sites in that set. (2) no starvation – no site should have to wait indefinitely to enter its critical section, while other sites are executing the CS more than once (3) fairness- requests honored in the order they are made. This means processes have to be able to agree on the order of events. (Fairness prevents starvation.) (4) fault tolerance – the algorithm is able to survive a failure at one or more sites. Distributed Mutex – Overview • Token-based solution : processes share a special message known as a token – Token holder has right to access shared resource – Wait for/ask for (depending on algorithm) token; enter Critical Section when it is obtained, pass to another process on exit or hold until requested (depending on algorithm) – If a process receives the token and doesn’t need it, just pass it on. Overview - Token-based Methods • Advantages: – Starvation can be avoided by efficient organization of the processes – Deadlock is also avoidable • Disadvantage: token loss – Must initiate a cooperative procedure to recreate the token – Must ensure that only one token is created! Overview...
View Full Document

Page1 / 39

A12_DistMutex_Ch6 - Synchronization in Distributed Systems...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online