What is a semaphore?
A semaphore 'S' is a synchronization tool which is an integer value that, apart from initialization, is accessed only by two standard atomic operations; wait and signal .Semaphores can be used to deal with the n-process critical section problem. It can be also used to resolve various Synchronization problems.