I would like to know why preemption does not solve priority inversion problem?
If we have preemptive kernel. Then why priority inversion problem does not get solved?
I would like to know why preemption does not solve priority inversion problem ?
Share
Ok, let’s say we have two processes. Let’s also assume that the process which has lower priority gets a lock. When the higher-priority process becomes ready, it preempts the other process. If the higher-priority process needs that lock, it can’t get it due to the other process which has lower priority. That means, lower-priority process blocks the higher-priority one. It prevents higher-priority process from running. This is called “Priority Inversion”.
Obviously, preemption is not a solution for priority inversion. The solution is “Priority Inheritance”. It means that we should temporarily increase the process’s priority whenever it acquires a lock that is also needed by a higher-priority process. It should be the highest-priority process among the other processes which might want the same lock.