views:

31

answers:

0

Can a single processor do I/O and CPU bound tasks together?

For example,

               arrival time       CPU time            I/O task time    

p1 .............................0........................................10........................................3

p2..............................2.........................................7.........................................2

p3............................. 4..........................................4.........................................1

If the process is scheduled in the order that CPU task are scheduled according to preemptive SJF scheduling and I/o bound task according to FCFS scheduling.

So my gant chart is like

p1 for 2 seconds ( p2 arrives after 2 seconds and displaces p1)

p2 for 2 seconds ( p3 arrives and ...)

p3 runs for 4 seconds.

problem comes here. Now I need to know that whether p3 will start executing its I/o operation right away and p2 will continue with CPU bound task simultaenously

or will I first finish up with all the CPU bound task and then start FCFS scheduling for IO process?

what I mean is after p3 runs for 4 seconds,

a) do I start away with p2 for CPU bound task and keep a hold on I/o bound task?

b) or do I start with p2 for CPU bound task and a simultaneous p3 run for I/O bound task.

Can someone give me all possible scenarios/configurations ( wether single processor/multiple etc etc conditions/limitations) for the both cases to run? Like can you tell me the all possible scenarios for which both of them would run?

Any help is much appreciated :)