Anonymous user menu

Can anyone explain, how does Livelock occur in case of prior

Can anyone explain, how does Livelock occur in case of priority inversion?

6Comments
jayendra @jayendra
20 Dec 2014 09:39 pm

ok, i have a beautiful real world example for livelock in case of priority inversion:

everyone knows that story of two wise goats. imagine the same scenario one bridge and goats are coming from opposite direction of the bridge. now if both of them decide to step back and becomes polite to each other. here what happens, deadlock is removed but none of them can progress. both of them can sit and watch others passing the bridge.

to avoid this type of situation generally any one of the process is chosen arbitrarily and stopped instead of both.

GateMaster Prime @gatemasterpr
22 Dec 2014 12:08 pm

nice example, thanks :)

Rosni K V @rosnikv
21 Dec 2014 07:54 am

Good example jayendra :)

 One low priority process was utilizing CPU and it is in critical section, High priority  process came, then preemption will happen and low priority will go to ready queue, High priority process is utilizing CPU, when it requires  critical section it wait till Low process complete critical section but low priority process without scheduling cant complete and it wait till high priority process complete . (" both of them can sit and watch others passing the bridge")

Live lock happens when process are in ready or running state while deadlock deals with blocked state.

Round robin like preemptive non priority based scheduling can solve this problem.

GateMaster Prime @gatemasterpr
22 Dec 2014 11:58 am

thanks a lott.. :)
This is the answer, i was looking for.

But i have a doubt,how could the higher priority process preempt the lower priority process, when the lower priority process is in execution(i.e. in critical section)..? As, preepmtion can only takes place after lower priority process is completed.

Rosni K V @rosnikv
23 Dec 2014 02:51 pm

Higher priority process preempted lower one from the CPU, (not from the critical section -- it's invalid )

Mahesh Kumar @maheshkumar
23 Dec 2014 01:55 pm

This is said to be priority inversion right?.what is Live lock then?