This answer is restricted. Please login to view the answer of this question.Login Now
Distinguish between starvation and deadlock are given below.
|Definition||Deadlock happens when every process holds a resource and waits for another process to hold another resource.||Starvation happens when a low priority program requests a system resource but cannot run because a higher priority program has been employing that resource for a long time.|
|Basic||A deadlock occurs when no process can proceed and becomes blocked.||Starvation occurs when low priority procedures are blocked while high priority operations proceed.|
|Other names||Deadlock is also known as circular wait.||Starvation is known as a Lived lock.|
|Resources||Other processes block requested resources while a process is deadlocked.||High-priority processes continue to use the requested resources.|
|Arising Condition||Mutual exclusion’s occurrence, Hold and wait, No preemption, and Circular wait all happen simultaneously.||Uncontrolled resource management, enforcement of priorities.|
|Prevention||It can be prevented by avoiding the situations that lead to deadlock.||Aging may prevent it.|
A multi-level queue scheduling algorithm partitions the ready queue into several separate queues. The processes are permanently assigned to one queue, generally based on some property of the process, such as memory size, process priority, or process type. Each queue has its own scheduling algorithm.
For example, separate queues might be used for foreground and background processes. The foreground queue might be scheduled by the Round Robin algorithm, while the background queue is scheduled by an FCFS algorithm.
In addition, there must be scheduling among the queues, which is commonly implemented as fixed-priority preemptive scheduling. For example, The foreground queue may have absolute priority over the background queue.
Let us consider an example of a multilevel queue-scheduling algorithm with five queues:
Each queue has absolute priority over lower-priority queues. No process in the batch queue, for example, could run unless the queues for system processes, interactive processes, and interactive editing processes were all empty. If an interactive editing process entered the ready queue while a batch process was running, the batch process will be preempted.
In this case, if there are no processes on the higher priority queue only then the processes on the low priority queues will run. For Example: Once processes on the system queue, the Interactive queue, and Interactive editing queue become empty, only then the processes on the batch queue will run.
Click here to submit your answer.