in Operating System
1,502 views
0 votes
0 votes
Is FCFS always non-preemptive?

If an I/O bound process comes, then? It will be preempted or not?
in Operating System
1.5k views

1 comment

Yes, FCFS is always non pre-emptive. Hence it is known to favour CPU bound processes.

When a process requires IO, it has to be moved in Wait/Block state. This goes for all scheduling algorithms, irrespective of being preemptive or not.
2
2

2 Answers

1 vote
1 vote
Best answer

FCFS Scheduling Algorithm: 

  • What comes at first gets scheduled first.

 

  • It's Non-Preemptive scheduling algorithm.
  • Convoy effect:
    • Since FCFS is non-preemptive, when a CPU intensive process comes, it takes a lot of CPU time while all the other processes are made to in the ready queue. So one process slows down the entire performance of the system.

 

  • What happens when an I/O bound process comes?
    • I/O bound processes are not CPU intensive usually. So they get executed quickly. 
    • The problem comes when I/O bound processes are followed by CPU intensive processes or vice versa.
      • When there are I/O bound processes in the ready queue waiting for CPU, but a CPU intensive process is executing, the I/O devices are forced to go idle.
      • When the CPU intensive process finishes its execution and it may move to I/O devices.
      • I/O bound processes get executed quickly and now when they come for I/O devices, it is not available since the CPU intensive process is accessing it. This may lead to CPU being idle.
      • No preemption happens even if an I/O bound process comes. 
selected by
1 vote
1 vote
Yes,  FCFS is always pre-emptive. (Non-Preemptive meaning that once a process is given to the CPU, then it can’t be taken away). Due to being non-preemptive, it is suitable for CPU bound processes. (CPU bound process - are the processes which require most of the time on CPU. Input bound - are the processes which require most of the time on peripherals).

What happens when an I/O bound process comes?
Most of the I/O bound processes are not CPU intensive. Hence, they get executed fast.
As the I/O bound processes get executed fast, but when they arrive for I/O devices, the CPU is not available as the CPU intensive process is using it.
This leads to the idleness of the CPU.

So, yes no “preemption” happens even though the I/O bound process comes.
by

Related questions

0 votes
0 votes
1 answer
4