hw5sol - CSE4/586 (Spring 2009): Homework 5 Due by Apr 23...

Info iconThis preview shows pages 1–2. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE4/586 (Spring 2009): Homework 5 Due by Apr 23 Thursday, in class. 1. (20 points) In Lamport’s logical clock based mutual exclusion protocol (Chapter 7) why do we need to have the following check for a process i entering the critical section? For all other j , knownT [ j ] must be larger than the timestamp of req i . Answer: Note that, the other condition (call it condition1) for process i to enter CS is that: req i is at the head of reqQ i . Due to channel delays and concurrent execution, different processes may have differing views on the pending requests for CS. It is possible that there exists a process j such that req j is at the head of reqQ j , while req i is at the head of reqQ i . If condition1 had been the only condition for entering the CS, then both processes would be free to enter CS concurrently, violating the specifications for the mutual exclusion problem. The condition2, that states: For all other j , knownT [ j ] must be larger than the timestamp of req i , ensures that any process i waits long enough to guarantee that it learns about all the pending requests-for-CS in the system that are less than req i . (This is because the channels are FIFO, and if i gets a message from j with timestamp larger than req i , it is guaranteed to have received any req j with timestamp less than req i . In other words, this condition enables a correct implementation of total order on requests-for-CS across processes by forcing them to wait until they learn about all pending requests at other processes that are less than their...
View Full Document

Page1 / 3

hw5sol - CSE4/586 (Spring 2009): Homework 5 Due by Apr 23...

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

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