Deadlock. Improper use of semaphores with wait queues can cause deadlock. Deadlock means a group of processes are all waiting for each other for some event.
Can semaphores prevent deadlock?
The first two properties express the basic feature of the semaphore or (mutual exclusive) lock operations. Therefore, one usually prevents deadlock by negating either the Hold and Wait or the Circularity conditions.
What are the disadvantages of semaphore?
Disadvantages of Semaphores
- Semaphores are complicated so the wait and signal operations must be implemented in the correct order to prevent deadlocks.
- Semaphores are impractical for last scale use as their use leads to loss of modularity.