Suppose an application has three threads:
Thread 1 has high priority. Thread 2 has medium priority. Thread 3 has low priority.
Assume that Thread 1 and Thread 3 use the same critical section code
At the beginning of the example, thread 1 and thread 2 drop or lock. Topic 3 launches and enters a critical section.
At this point, thread 2 starts, displacing thread 3, because thread 2 has a higher priority. So, stream 3 continues to own a critical sector.
Later, thread 1 starts, displacing thread 2. Thread 1 tries to enter the critical section to which thread 3 belongs, but since it belongs to another thread, thread 1 blocks, waiting for the critical section.
At this point, thread 2 starts because it has a higher priority than thread 3, and thread 1 does not work. Thread 3 never releases the critical section that thread 1 expects, as thread 2 continues to run.
Consequently, the thread with the highest priority in the system, thread 1, becomes blocked, waiting for threads with lower priority to execute.
Pratik Bhat 01 Oct '13 at 22:45 2013-10-01 22:45
source share