(Latest Revision:10/03/2001)  
(10/03/2001: modified "coverage" of Exam #1) 
(10/03/2001: incorporated pointer to the new review materials) 
Week 05 Notes for CS 3750 -- Fall 2001 
-  Take Roll. 
 -  Announcements  
     
     -  We will have quiz #1 on Wednesday, October 10.  The
	  quiz will cover chapters 1-5.  You will find some
	  review materials here: 
           Fall 2001 Review
	  Materials
          
          Note: these review materials are up to date -- geared
	  toward the latest edition of the text.
      -  
     
 
 
 -  Check what's new in schedule  
 -  Chapter Seven Notes -- Process Synchronization 
     
     -  7.1 Background -- The unsuccessful attempt at a new
	  solution to the bounded buffer problem illustrates that
	  concurrent processes accessing shared memory may need
	  to synchronize and provide mutually exclusive access in
	  order to preserve data integrity. 
      -  7.2 The Critical Section Problem   
          
          -  Processes P1 ... Pn each have a "critical" section
	       of code C1 ... Cn.  We want to program all the
	       processes so at most one of the processes is
	       executing in its critical section at any time
	       (mutual exclusion).  Typically the reason is that
	       the critical section of code contains accesses to
	       shared memory.  
           -  We want to solve the problem by giving each
	       process a module of "entry code" to be executed
	       just prior to entering its critical section and
	       "exit code" to be executed just after exiting its
	       critical section.  The goal is that the processes
	       will perform all the communication necessary to
	       maintain mutually exclusive access by executing
	       the entry and exit code.  
           -  In order that our solution to the critical section
	       problem be truly satisfactory, we require that the
	       following goals be achieved:  
               
               -  Mutual Exclusion: If process Pi is executing
		    in its critical section, then none of the
		    other processes can be executing in their
		    critical section. 
                -  Progress: If no process is executing in its
		    critical section and some processes wish to
		    enter their critical sections, then only
		    those processes that are not executing in
		    their remainder section can participate in
		    the decision on which will enter its critical
		    section next, and this selection cannot be
		    postponed indefinitely. 
                -  Bounded Waiting: There exists a bound on the
		    number of times that other processes are
		    allowed to enter their critical sections
		    after a process has made a request to enter
		    its critical section and before that request
		    is granted. 
                
           -  To understand the criteria for a solution to a
	       critical section problem, you must understand
	       completely the term "indefinite postponement" --
	       an event is postponed indefinitely if there is no
	       bound on how much time can go by before the event
	       occurs.   
           -  Algorithm 1 (mutual exclusion, but not progress)
	       
           -  Algorithm 2 (mutual exclusion, but not progress --
	       transpose two lines and you lose mutual exclusion
	       
           -   Algorithm 3  (works! -- Petersen 1981) 
           -   Multiple Process Solutions  
                
                -  The Bakery Algorithm (Lamport 1974)
                 -  The Eisenberg-McGuire Algorithm (1972) 
                 
 
           
      -  7.3 Synchronization Hardware   
          
      -     
      
 -