A semaphore is a variable associated with a list of processes.
Using semaphores to synchronize multiple processes.
In UNIX there are two main functions for the management of traffic lights: wait and signal. Wait decrements a counter and if the counter is less than zero blocks the process waiting for it come back positive again. The signal increments the counter.
Signal and wait work in mutual exclusion. A deadlock occurs if a process waits for an event to be caused by a blocked process. The perpetual starvationis a block where a job is never removed from the list where it is clamped.