This, in turn, wastes CPU time that could be put to better use getting the process in the critical region through it so another process can enter. Another problem that might exist is that it is possible for one process to enter the critical region, locking other processes out, leave the critical region, do some processing, and then reenter the critical region all during the same time slice. If it turns out that the process is always in the critical region when the timer interrupt occurs, none of the other processes waiting to enter the critical region will ever do so. This is a problem known as starvation - processes waiting to enter the critical region never do so because some other process always beats them into it. One solution to these two problems is to use a synchronization object known as a semaphore.
Semaphores provide an efficient and general purpose mechanism for protecting critical regions.