Deadlock vs Starvation

STARVATION DEADLOCK
The basic difference between deadlock and starvation is that deadlock can be avoided or recovered but starvation can only be avoided.
Basically,deadlock is the condition when the same resource is required by more than one process and none of the process is exactly using the resources. for example, if we've process p1,which requires resource r1 and holding the resource r2 , and a process p2 which requires resource r2 and holding the resource r1,now p1 will wait for process p2 to complete and to release the resource r1, and p2 will wait for process p1 to complete and to release the resource r2, and none of the process will be completed ,hence here we come across with condition of deadlock.
Starvation is the which occurs to a process due to not getting the chance to execute. for example,
if we are using SJF algorithm for scheduling, then there are chances that a lengthy process is keep on waiting, while short process are coming continously to the queue and hence shorter processes will keep on executing and the larger process will not be executed till the time out and here it will be in the condition of starvation.
Starvation is the which occurs to a process due to not getting the chance to execute. for example,
if we are using SJF algorithm for scheduling, then there are chances that a lengthy process is keep on waiting, while short process are coming continously to the queue and hence shorter processes will keep on executing and the larger process will not be executed till the time out and here it will be in the condition of starvation.
No comments:
Post a Comment