n For n processes
n Initialize S.count to 1
n Then only 1 process is
allowed into CS
(mutual exclusion)
n To allow k processes
into CS, we initialize
S.count to k
Process Pi:
repeat
  wait(S);
   CS
  signal(S);
   RS
forever