This preview shows page 1. Sign up to view the full content.
Unformatted text preview: class. The shared variables are the integer turn and the integer array flag . There are two processes, P0 and P1. These processes execute the following code in a loop running on a single CPU with a time sharing operating system. P0 code: P1 code: ======= ======= flag = 1; flag = 1; turn = 1; turn = 0; while( (flag==1) && (turn==1) ) ; while( (flag==1) && (turn==0) ) ; <critical section> <critical section> flag = 0; flag = 0; <remainder section> <remainder section> a) Explain why this solution satisfies bounded waiting b) Explain why this solution satisfies progress c) Explain why this solution satisfies mutual exclusion...
View Full Document
This note was uploaded on 09/21/2009 for the course CS 3733 taught by Professor Staff during the Spring '08 term at The University of Texas at San Antonio- San Antonio.
- Spring '08