Consider a system running 200 I/O-bound jobs and 10 CPU-bound job. Assume that the I/O-bound jobs issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10 milliseconds to complete. Also assume that the context switching overhead is 0.1millisecond and that all processes are long-running tasks. What percentage of CPU time is wasted in context switch for a round-robin scheduler when:
(a) The time quantum is 1 milliseconds
(b) The time quantum is 10 milliseconds
Answer:
(a) The time quantum is 1 millisecond:
Irrespective of which process is scheduled, the scheduler incurs a 0.1 millisecond context-switching cost for every context-switch.
Therefore, percentage of CPU time is wasted in context switch = (1/1.1) * 100 = 90.90%.
(b) The time quantum is 10 milliseconds:
The I/O-bound tasks incur a context switch after using up only 1 millisecond of the time quantum.
The time required to cycle through all the processes is therefore (1ms + 0.1ms) ∗ 200 + (10ms + 0.1ms) * 10 = 321ms
(as each I/O-bound task executes for 1 millisecond and then incur the context switch task, whereas the CPU-bound task executes for 10 milliseconds before incurring a context switch).
Actual total time taken via both the jobs = 1 * 200 + 10 * 10 = 300
Therefore, percentage of CPU time is wasted in context switch = (300 / 321 ) * 100 = 93.45%
The CPU utilization is therefore 20/21.1 * 100 = 94%.
Please give thumbsup, if you like it. Thanks.
Consider a system running 200 I/O-bound jobs and 10 CPU-bound job. Assume that the I/O-bound jobs...
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...
Question 4 [Points 4] Consider a system running 2 (two)CPU-bound tasks (C1-C2) and 1(one) I/O-bound tasks(I1). I/O bound task issues an I/O operation once every 1millisecond ofCPU. Each I/O operation takes 10milliseconds. Assume that there is only one I/O device (so multiple I/O requests may have to queue). Assume that the context switch takes 1 millisecond. Assume that each CPU-bound requires 20 milliseconds of CPU to complete and each I/O-bound task requires 2millisecondof CPU time. Show through a Ganttt chart...
Five processes arrive to run on a CPU. The scheduler puts them in its data structure. The table below lists the processes, how much CPU time each will need, and the priority of each process. One(1) is the highest priority and 4 is the lowest priority. Process CPU time needed Priority P1 P2 P3 NNW-W a. The scheduler uses First Come First Serve to schedule the jobs. Fill in the time line below showing at what time each process starts...
10. (10 pts) A process runs on an average for T msec before blocking for some I/O activity. A context switch takes on an average S msec. For round-robin scheduling with a quantum of Q msec (S not included in Q), give a formula for CPU eciency for each of the following (de ne CPU eciency as the fraction of time spent running the process): (a) Q = 1. (b) S < Q < T. (c) Q is nearly 0.
The CPU and I/O times for 2 processes are shown below. Assume
that P1 gets to the ready queue just before P2 and the scheduling
algorithm used by the OS is Round Robin with a time slice of 3 time
units. Assume that the I/Os for the processes are different so that
there is no I/O queue. Assume also that an interrupt from a
completed IO for process "X" will place process "X" in the ready
queue BEHIND the process...
Q2.Assume the following schedule for a set of three jobs, A, B, and C, with a single CPU. Assume that there is no i/o. --A runs first (for 10 time units) but is not yet done. --B runs next (for 10 time units) but is not yet done --C runs next (for 10 time units) and runs to completion --A runs to completion (for 10 time units) --B runs to completion (for 5 time units) Which scheduling disciplines could allow...
4. A multi-programmed operating system running on a single CPU assigns time slices of CPU time to the virtual machines that run the individual programs. Each virtual machine is given access to the CPU for a certain time (the time slice), during which it will continue to execute its program. The next time slice then goes to another virtual machine, and so on. Assume that each time slice is one millisecond (1/1000 of a second) long and the computer on...
Q1. Consider the following jobs having I/O wait of 70% with Arrival time and CPU minutes needed. 40 Marks Jobs Arrival Time 13:10 CPU minutes needed 8 1 13:30 6 3 13:40 4 4 13:50 4 5 13:55 3 Calculate CPU idle, CPU busy and CPU busy/ process 10 Marks Draw a graph showing no. of jobs and when it completes. 30 Marks Note: You can consult with slide # 7 of uploaded Lecture # 7. Page 1 of 1
4. A multi-programmed operating system running on a single CPU assigns time slices of CPU time to the virtual machines that run the individual programs. Each virtual machine is given access to the CPU for a certain time (the time slice), during which it will continue to execute its program. The next time slice then goes to another virtual machine, and so on. a. Assume that each time slice is one millisecond (1/1000 of a second) long. The computer on...