Student Name:                                             SID:                                                        Section:
CIS332 (Fall 1998) Principles of Operating Systems;   Professor Franz J. Kurfess
Home page:http://www.cis.njit.edu/franz   E-mail:franz@cis.njit.edu
Homework  Task  Deadline  Points 
Process Synchronization Monday, Oct. 05, 1998  10 
1. One method for the cooperation of processes is through shared data. A problem here can be data integrity; two processes modify the same data item in an uncoordinated way, and the result is not what it should be. Analyse the following example with respect to data integrity: Two processes P0 and P1 share the two data items a and b; it is important for the overall program that the relationship a = b always is maintained. Is this guaranteed for the following code? (3 points)
 
      P1: a := a + 1;
          b := b + 1;
      P2: b := b * 2;
          a := a * 2; 
Please note that processes can be interrupted at any point during their execution, and that there are several possible sequences for the execution of the above instructions.
 
 
 
 
 
 
 
 
 
 

2. How does the concept of critical sections help with solving the above problem? (3 points)
 
 
 
 
 
 
 
 
 
 

3. What is the difference between critical sections and critical regions? (4 points)