[iOS] - Semaphore to control access to shared resource
- DispatchSemaphore is initialized with maximum number of threads to access the shared resource.
- It provides methods wait()/signal() to lock/unlock resource
- If the resource access is locked in a lower priority thread by semaphore, it freezes and releases the resource until finish it although the higher priority thread is there, this is called Priority Inversion or Priority Inheritance.
- Multiple Semaphore access resource wait for each other can cause deadlock
No comments:
Post a Comment