Lec8 - ECE151 Lecture 8 Chapter 5 Synchronization ECE151 Lecture 8 1 Mutual Exclusion Problem A number of processes in a distributed system want

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

View Full Document Right Arrow Icon
ECE151 – Lecture 8 1 ECE151 – Lecture 8 Chapter 5 Synchronization
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE151 – Lecture 8 2 Mutual Exclusion Problem: A number of processes in a distributed system want exclusive access to some resource. Basic solutions: Via a centralized server. Completely distributed, with no topology imposed. Completely distributed, making use of a (logical) ring.
Background image of page 2
ECE151 – Lecture 8 3 Mutual Exclusion: A Centralized Algorithm a) Process 1 asks the coordinator for permission to enter a critical region. Permission is granted b) Process 2 then asks permission to enter the same critical region. The coordinator does not reply. c) When process 1 exits the critical region, it tells the coordinator, when then replies to 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
ECE151 – Lecture 8 4 Principle: The same as Lamport except that acknowledgments aren’t sent. Instead, replies (i.e. grants) are sent 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). In all other cases, reply is deferred , implying some more local administration.
Background image of page 4
ECE151 – Lecture 8 5 A Distributed Algorithm a) Two processes want to enter the same critical region at the same moment. b) Process 0 has the lowest timestamp, so it wins. c) When process 0 is done, it sends an OK also, so 2 can now enter the critical region.
Background image of page 5

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

View Full DocumentRight Arrow Icon
ECE151 – Lecture 8 6 A Token Ring Algorithm a) An unordered group of processes on a network. b) A logical ring constructed in software. Essence: Organize processes in a logical ring, and let a token be passed between them. The one that holds the token is allowed to enter the critical region (if it wants to)
Background image of page 6
ECE151 – Lecture 8 7 Comparison A comparison of three mutual exclusion algorithms. Lost token, process crash 0 to n – 1 1 to Token ring Crash of any process 2 ( n – 1 ) 2 ( n – 1 ) Distributed Coordinator crash 2 3 Centralized Problems Delay before entry (in message times) Messages per entry/exit Algorithm
Background image of page 7

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

View Full DocumentRight Arrow Icon
ECE151 – Lecture 8 8 Distributed Transactions The transaction model Classification of transactions Concurrency control
Background image of page 8
ECE151 – Lecture 8 9 The Transaction Model Updating a master tape is fault tolerant.
Background image of page 9

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

View Full DocumentRight Arrow Icon
ECE151 – Lecture 8 10 The Transaction Model Examples of primitives for transactions. Write data to a file, a table, or otherwise WRITE Read data from a file, a table, or otherwise READ Kill the transaction and restore the old values ABORT_TRANSACTION Terminate the transaction and try to commit END_TRANSACTION Make the start of a transaction BEGIN_TRANSACTION Description Primitive
Background image of page 10
ECE151 – Lecture 8 11 The Transaction Model a) Transaction to reserve three flights commits b) Transaction aborts when third flight is unavailable Essential: All READ and WRITE operations are executed, i.e. their effects are made permanent at the execution of END_TRANSACTION . Observation:
Background image of page 11

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

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

This note was uploaded on 05/04/2008 for the course ECE 151 taught by Professor Melliar-smith during the Spring '08 term at UCSB.

Page1 / 34

Lec8 - ECE151 Lecture 8 Chapter 5 Synchronization ECE151 Lecture 8 1 Mutual Exclusion Problem A number of processes in a distributed system want

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

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