Home | | Schedule | | Assignments | | Lecture Notes
Due: Thursday, April 28, in class
Answer the following questions. Your answers should be typed (except for the Gantt diagrams, which you may draw by hand).Question 1. Briefly define each of these terms (one or two sentences each):
Question 2. Consider a concurrent system with two processes, P and Q, shown in the following code. A, B, C, D, and E are arbitrary atomic (indivisible) statements. Assume that these two processes are executing concurrently.
Process P | Process Q |
begin | begin |
A; | D; |
B; | E; |
C; | end. |
end. |
Question 3. Does the following solution to the critical section problem for
three processes satisfy mutual exclusion? Justify your
response.
Concurrent Flags:
There are three flags (shared variables): flag1, flag2 and flag3
There is one shared variable, sign, that is set to 1, 2 or 3, corresponding to each process.
initially: all flags are false and sign is set to 1.
Process A:
while(1) { //do some stuff flag1 = true; sign = 1; while ((flag2 || flag3) && (sign == 1)) { // do nothing } //critical section ... flag1 = false; } |
Process B:
while(1) { //do some stuff flag2 = true; sign = 2; while ((flag1 || flag3) && (sign == 2)) { // do nothing } //critical section ... flag2 = false; } |
Process C:
while(1) { //do some stuff flag3 = true; sign = 3; while ((flag1 || flag2) && (sign == 3)) { // do nothing } //critical section ... flag3 = false; } |
Question 4. Suppose a fixed partitioning memory system with partitions of 100K, 500K, 200K, 300K, and 600K (in memory order) exists. All five partitions are currently available.
Question 5. Consider a logical address space of eight pages of 1024 bytes each, mapped onto a physical memory of 32 frames.
Completed homework:
Constance Royden--croyden@mathcs.holycross.edu
Computer Science 346--Operating Systems
Date Created: January 9, 2004
Last Modified: April 14, 2011
Page Expires: January 8, 2012