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.