Using semaphores for solving critical section problems
nFor n processes
nInitialize S.count to 1
nThen only 1 process is allowed into CS (mutual
exclusion)
nTo allow
k processes into CS, we initialize S.count to k
Process Pi:
repeat
wait(S);
CS
signal(S);
RS
forever