• support@answerspoint.com

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

1229

Please Explain Difference between Deadlocks and Starvation

4Answer


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 4 years 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 4 years ago
  • Sunny Solu

0

A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function

  • answered 2 years ago
  • Abha Sharma

0

In an operating system, a deadlock occurs when a process or thread enters a waiting state because a requested system resource is held by another waiting process, which in turn is waiting for another resource held by another waiting process.

  • answered 2 years ago
  • Abha Sharma

Your Answer

    Facebook Share        
       
  • asked 4 years ago
  • viewed 1229 times
  • active 4 years ago

Best Rated Questions