Difference Between Deadlock and Starvation in Operating System OS
The computer is considered one of the most successful inventions of mankind and has managed to serve us with hassle-free experiences while completing certain tasks. It has created a feasible space for us by helping us make our work life and even social life better. When we perform certain tasks on computers, there ought to happen some problems because of some technical issues. Two of such difficulties are 1. Deadlock and 2. Starvation in Operating System OS.
Deadlock vs Starvation in Operating System OS
The main difference between deadlock and starvation in an operating system os is the time when they occur. Deadlock occurs when a resource is held by processes and waits for other process-held resources. On the other hand, starvation in the operating system os occurs when processes with low priority are blocked, and execution of high priority processes take place.
The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock. Deadlock is generally witnessed in both multiprocessing and distributed systems and also in parallel computing. In a deadlock, shared resources of the processes are adjudicated by hardware and software locks for implementation of process synchronization. The reason for the occurrence of deadlock in communication systems is the loss or corruption of signals.
The occurrence of a problem when processes of low priority are blocked, and the processes with high priority are carried out is known as starvation in the operating system os. Starvation is the major problem in the priority scheduling algorithm as it causes uncertain waiting of the low priority procedures. Starvation also occurs in concurrent computing. Some of the causes of starvation include errors in scheduling, resource leaks etc. An example of starvation is the third task in a multitasking system that switches between its first two tasks is never carried out or is starved because of CPU time.
Comparison Table Between Deadlock and Starvation in Operating System OS
Parameters of Comparison | Deadlock in Operating System OS | Starvation in Operating System OS |
Meaning | The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock. | When processes of low priority are blocked and are not allowed, the resources and the processes with high priority are carried out by allowance of resources is known as starvation in the operating system os. |
Also Known As | Circular wait | Lived Lock |
Resources | Resources are held by another waiting process. | High priority processes use resources. |
Causes | The simultaneous occurring of no preemption and circular wait, Mutual exclusion, hold and wait. | Errors in scheduling, No control over resource management, Limitations in resources. |
Prevention | Allowance of preemption. | Aging. |
What is Deadlock in Operating System OS?
The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock. A deadlock is known as Circular wait. Both multiprocessing and distributed systems and also parallel computing witness deadlock situation. It is also observed in a communication system.
The occurrence of deadlock is because of reasons like Simultaneous occurring of no preemption and circular wait, Mutual exclusion, hold and wait. If these four things take place simultaneously, then a deadlock will take place. The occurrence of deadlock in communication systems takes place because of the loss or corruption of signals.
The primary example of deadlock is, Process 1 is using Resource 2 of Process 2 and Process 2 is still carried out. Deadlock can be prevented by an allowance of preemption, using a resource allocation graph etc. These resource allocation graphs can also be helpful to detect a deadlock when a certain task or algorithm is executed.
Different operating systems handle the situation of deadlock differently. The approaches towards a deadlock situation include ignoring deadlock, detection, prevention etc. There exist distributed deadlocks that occur in distributed systems because of distributed transaction or usage of concurrency control. Distributed deadlocks are avoided by drafting a global wait-for graph or by carrying out a distributing algorithm.
What is Starvation in Operating System OS?
The occurrence of a problem when processes of low priority are blocked and are not allowed the resources and the processes with high priority are carried out by allowance of resources is known as starvation in the operating system os. The starvation in operating system OS is also known as Lived Lock.
The reasons behind the occurrence of starvation in the operating system are Errors in scheduling, No control over resource management, Limitations in resources. The third task in a multitasking system that switches between its first two tasks is never carried out or is starved because CPU time is a prominent example of starvation.
The priority processes in the system that wait for a long time are gradually increased. This process is called Aging. The process of Aging is one of the measures of prevention or rather is a solution for starvation in the operating system. Generally, in a heavily loaded computer system, the low priority processes are prevented by high priority processes from ever getting the CPU.
The prevention of starvation in the operating system can be done by other methods such as avoiding processes that cause starvation such as avoid selecting random processes for resource allotment. The algorithm where starvation is not possible is called starvation-free or lockout-freed.
Main Differences Between Deadlock and Starvation in Operating System OS
Conclusion
Both, deadlock and starvation in the operating system are the difficulties that are ought to arise because of data clans or programming conditions that occur during implementation of hardware. These difficulties might hinder the hassle-free experience of an user while using the computer.
These issues can be resolved by taking necessary steps and preventive procedures. It is a user’s responsibility as well to make optimum use of the device and avoid such difficulties.
References
ncG1vNJzZmiZo6Cur8XDop2fnaKau6SxjZympmeUnrOnsdGepZydXZeytcPEnqVmnJWWsa27wqRkmqaUYsC1rdGvmK2hn6N6qrqMqKeeqpGptq%2BzjKywrKyVonqwv44%3D