Access Millions of academic & study documents

A system is running 2 CPU bound tasks and 4 IO bound tasks Each I

Content type
User Generated
Showing Page:
1/3
A system is running 2 CPU-bound tasks and 4 I/O-bound
tasks. Each I/O bound task issues an I/O operation once
every 1 millisecond of CPU. Each I/O operation takes 4
milliseconds. Assume that there is only one I/O device (so
multiple I/O requests may have to queue). Assume that the
context switch takes 0.2 milliseconds. Assume that each
CPU-bound requires 10 milliseconds of CPU to complete
and each I/O-bound task requires 2 milliseconds of CPU
time. Show through a Gantt chart how the I/O and CPU are
allocated and compute the average turnaround times for
the CPU-bound and I/O bound tasks.
Solution
each I/O task is going to get 1ms of CPU time but that\'s
all it needs before going into I/O land and then the
scheduler switches to the next one which takes .1ms for a
total of 1.2ms. So for 4 I/O tasks, we have 4*1.2ms =
0.8ms of which 10ms is CPU time. For the CPU task, I
assumed it wants to run 10ms at a time to make up for the
I/O tasks but since it is partitioned into 1ms chunks, it will
also take 1.1ms for each slice giving a total 10*1.1ms =
11ms. Therefore, both tasks together will take 22ms to
complete a cycle but only take 20ms of CPU time => 20/22
= 91%.

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/3
Each I/O task will use 2ms of CPU time then the scheduler
will pick another task (because the I/O task is off in I/O
land). In this way, we get same 11ms for all the I/O tasks
to have a turn but the outcome changes for the CPU task
because it will get a full 10ms before getting pushed back
to the end of the queue giving it 10.1ms total. Therefore,
both tasks together will take 21.1ms to complete for 20ms
of CPU time => 20/21.1 = 94%.
f you treat all tasks the same, then each task will have 1ms
of CPU time and the scheduler will take up .1ms for a total
of 1.1ms. Since each task is essentially the same (since
they all will take 1ms of CPU time at each run), we can
pretend we have a single task => 1/1.1 = 91%
CPU Utilization
20/21.1 * 100 = 94%,
1/1.1 * 100 = 91%.
GAntt Chart-
FCFS- 1 2 3 4 5
RR- 1 2 3 4 5 1 3 5 15 15 15 1
SJF- 2 4 3 5 1
Priority- 2 5 1 3 4

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/3

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
A system is running 2 CPU-bound tasks and 4 I/O-bound tasks. Each I/O bound task issues an I/O operation once every 1 millisecond of CPU. Each I/O operation takes 4 milliseconds. Assume that there is only one I/O device (so multiple I/O requests may have to queue). Assume that the context switch takes 0.2 milliseconds. Assume that each CPU-bound requires 10 milliseconds of CPU to complete and each I/O-bound task requires 2 milliseconds of CPU time. Show through a Gantt chart how the I/O and CPU are allocated and compute the average turnaround times for the CPU-bound and I/O bound tasks. Solution each I/O task is going to get 1ms of CPU time but that \'s all it needs before going into I/O land and then the scheduler switches to the next one which ta kes .1ms for a total of 1.2ms. So for 4 I/O tasks, we have 4*1.2ms = 0.8ms of which 10ms is CPU time. For the CPU task, I assumed it wants ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4