Assignment 2

Operating Systems Principles

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CPSC435 (W2008) Operating Systems Answer Key for Assignment 2 (problems) 1. Solve Problem 8 (p. 67) in the textbook. (a) c 1 = 1; regardless of the values of c 2 and turn , p 2 must wait. (b) c 1 = 1, c 2 = 1, and turn = 1 or 2; since turn can only have one of the possible values, only one process will pass the test. (c) c 1 = 0, c 2 = 1, and turn = 1;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c 2 and turn both remain 1, which allows p 2 to enter repeatedly 2. Solve problem 9 (pp. 67-68) in the textbook. Justify your answer . This solution does NOT work. Assume p 1 is in its critical section. Then p 2 will set c 2 to 1 and will_wait to 1. This allows it to pass the test and enter its critical section as well....
View Full Document

This document was uploaded on 05/19/2008.

Ask a homework question - tutors are online