1
$\begingroup$

Some scheduling algorithms favour CPU bound processes while others favour I/O bound processes.
Which algorithm favours which type of process?
My answers:

  1. SJF favours I/O bound processes.
    Explanation: Short CPU burst processes(I/O bound processes) are given higher priority.
  2. SRTF favours I/O bound processes.
    Explanation: Same as SJF
  3. Round Robin? Not able to decide categorically
  4. LRTF favours CPU bound processes.
    Explanation: Large CPU burst processes(CPU bound) are given higher priority.
  5. HRRN? Not able to decide categorically
  6. Multilevel feedback Queue favours I/O bound processes.
    Explanation: Short CPU burst processes(I/O bound processes) are given higher priority. While processes that have large CPU bursts(CPU bound) will slowly have decrement in priority. A process in lower priority queue can only execute when higher priority queues are empty. A process running in a lower priority queue is interrupted by a process arriving in a higher priority queue.
  7. Multilevel Queue favours I/O bound processes.
    Explanation: Similar to multilevel feedback.
  8. Priority Scheduling? Not able to decide categorically
  9. FCFS? Not able to decide categorically


Please verify above answers and explanations.
Correct me if I'm wrong somewhere and provide answers with explanation for the omitted ones.

$\endgroup$
2
  • 1
    $\begingroup$ Please ask one question per post, not several. We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? $\endgroup$
    – D.W.
    Dec 31 '20 at 6:29
  • $\begingroup$ Sir, I've seen such questions being asked and answered so I wanted to make this concept clear for all algorithms at once which will surely help future visitors. Look at this question dba.stackexchange.com/questions/160241/… mine was inspired from this because that question cleared all doubts regarding no. of tuples $\endgroup$ Dec 31 '20 at 8:44
1
$\begingroup$

First of all, let me clarify that the CPU Burst Time of a process has no relation with being a CPU or I/O bound process. A CPU-bound process is one that spends most of its execution time at CPU and an I/O-bound process is one that spends most of its execution time at an I/O device. Therefore, a process having a small CPU burst time can also be a CPU-bound process. Similarly, a process having a very large CPU burst time can still be I/O bound.

For example, consider a process A having CPU burst time of 1ms and I/O burst time of 5 ms. It is clearly an I/O-bound process. And a process B having a CPU burst time of 10ms and I/O burst time of 5 ms is clearly a CPU-bound process. But if we consider SJF or SRTF algorithms, they will definitely prefer process A over B inspite of A being I/O bound and B being CPU bound because A has a lower CPU burst time than that of B. Thus, it is incorrect to think that SJF favors I/O bound processes.

But, as I/O bound processes spend more time doing I/O than CPU, they will be sent to the waiting state more often. (It has nothing to do with CPU scheduling as CPU scheduling is handled by Short Term Scheduler and waiting state is handle by Medium Term Scheduler). Once a process in waiting finishes its I/O, it now depends on the CPU Scheduler. Now, if any preemptive algorithm is being used, there are chances that this process will get execution (depending on the criteria). But if any non-preemptive algorithm is being used, this process won't get execution until the currently executing process is finished. So, we can say that non-preemptive algorithms (kind of) favor CPU-bound processes (as they spend more time at the CPU, so they have to face lower chances of waiting).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.