© Thomas Kunz 2000
SCE 574
215
Semaphores and Critical Sections
äFor n processes
äInitialize S.count to 1
äThen only 1 process is allowed into CS (mutual exclusion) äTo allow k processes into CS, we initialize S.count to k
Process Pi:
repeat
  wait(S);
   CS
  signal(S);
   RS
forever