Sunday 11 March 2012

Algorithm 3


  • Combined shared variables of algorithms 1 and 2.
  • Process Pi
  do {
  flag [i]:= true;
  turn = j;
  while (flag [j] and turn = j) ;
  critical section
  flag [i] = false;
  remainder section
  } while (1);
  • Meets all three requirements; solves the critical-section problem for two processes.

No comments:

Post a Comment