1,651 views

1 Answer

2 votes
2 votes
Spinlock occurs simply in busy waiting solutions to critical section problem. In Spinlock when the process Pi in CS (critical section) get preempted and the some other process Pj who wants to access CS get scheduled by ST sheduler, however the process Pj will not be allowed to enter CS and will be just looping on & on thus wasting CPU cycles. And after some time Pi will again get scheduled and then Pj can enter CS.

 
Priority Inversion is a problem occuring due to priority and leads to deadlock. Here what happens is our synchronisation algo has permitted proccess Pi to enter CS, however a new process Pj gets into Ready queue, Pj having priority greater than Pi, So Pj will get CPU but now it gets blocked by our synchronisation algo. So being high priority process Pj will be present in CPU until it got completed, And since Pi is the one who acquired the LOCK so our sync. algo will block all other process from entering CS. This leads to Deadlock.

 

I read this from GALVIN book.

Related questions

0 votes
0 votes
3 answers
3
Jarvis asked Jun 11, 2015
997 views
Can priority inversion be solved using sleep and wake approach and avoiding busy wait?
7 votes
7 votes
1 answer
4
Tuhin Dutta asked Sep 29, 2017
3,430 views
State the difference between livelock and spinlock.