• support@answerspoint.com

What is deadlocks? what is starvation? How do they differ from each other?

449

Please Explain Difference between Deadlocks and Starvation

2Answer


0

Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.
Consider an example when two trains are coming toward each other on same track and there is only one track, none of the trains can move once they are in front of each other. Similar situation occurs in operating systems when there are two or more processes hold some resources and wait for resources held by other(s). For example, in the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1.

  • answered 6 months ago
  • Sunny Solu

0

 

Starvation is the phenomena in which a process is not able to acquire the desired resources (like processor, I/O device etc) for a very long time to progress with its execution.

This can happen due to drawbacks of scheduling algorithms. Scheduling algorithms are used to decide to which process the resource(s) needs to be given next. Example:

  • In Shortest Job First Algorithm, if there is a process with a rather large CPU burst waiting for its execution and a stream of processes with smaller CPU burst keep entering the ready queue (a queue consisting of those processes which are ready to execute), then the CPU will always be allocated to the process with the shorter CPU burst and there is a probability that the process with the large CPU burst might never get the CPU to complete its execution and starve.
  • In Priority Scheduling, a constant stream of high priority processes might starve one or more lower priority process(es) as the CPU will always be allocated to the process with highest priority.

 

 

 

  • answered 6 months ago
  • Sunny Solu

Your Answer

    Facebook Share        
       
  • asked 6 months ago
  • viewed 449 times
  • active 6 months ago

Hot Questions