For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?
Process Arrival Time Processing Time
A 0 3
B 1 6
C 4 4
D 6 2
Turnaround time is the total time taken between the submission of a program/process/thread/task (Linux) for execution and the return of the complete output to the customer/user. Turnaround Time = Completion Time - Arrival Time. FCFS = First Come First Serve (A, B, C, D) SJF = Non-preemptive Shortest Job First (A, B, D, C) SRT = Shortest Remaining Time (A(3), B(1), C(4), D(2), B(5)) RR = Round Robin with Quantum value 2 (A(2), B(2), A(1),C(2),B(2),D(2),C(2),B(2)
Which of the following is FALSE about SJF (Shortest Job First Scheduling)?
S1: It causes minimum average waiting time
S2: It can cause starvation
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?
Turnaround time is the total time taken by the process between starting and the completion and waiting time is the time for which process is ready to run but not executed by CPU scheduler. As we know, in all CPU Scheduling algorithms, shortest job first is optimal i.ie. it gives minimum turn round time, minimum average waiting time and high throughput and the most important thing is that shortest remaining time first is the pre-emptive version of shortest job first. shortest remaining time first scheduling algorithm may lead to starvation because If the short processes are added to the cpu scheduler continuously then the currently running process will never be able to execute as they will get pre-empted but here all the processes are arrived at same time so there will be no issue such as starvation. So, the answer is Shortest remaining time first, which is answer (A).
Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.
The average turn around time of these processes is ___________ milliseconds. Note : This question was asked as Numerical Answer Type.
PreEmptive Shortest Remaining time first scheduling, i.e. that processes will be scheduled on the CPU which will be having least remaining burst time( required time at the CPU). The processes are scheduled and executed as given in the below Gantt chart.
Turn Around Time(TAT) = Completion Time(CT) - Arrival Time(AT) TAT for P1 = 20 - 0 = 20 TAT for P2 = 10 - 3 = 7 TAT for P3 = 8- 7 = 1 TAT for P4 = 13 - 8 = 5 Hence, Average TAT = Total TAT of all the processes / no of processes = ( 20 + 7 + 1 + 5 ) / 4 = 33 / 4 = 8.25 Thus, A is the correct choice.
Assume every process requires 3 seconds of service time in a system with single processor. If new processes are arriving at the rate of 10 processes per minute, then estimate the fraction of time CPU is busy in system?
10 processes -> 1 min
1 process-> 1/10 min = 6 sec (Arrival rate)
Each process -> 3 sec service time 3/6 * 100 = 50% of time CPU is busy.
When an interrupt occurs, an operating system
Scheduler decides that the interrupted process will complete execution or some other process will be executed. If the interrupt signaled an I/O completion event, and at the same time a high priority process came into Ready state then the scheduler block the interrupted process and dispatch the high priority process in the running state. If low priority process comes into Ready state then scheduler dispatch the interrupted process. Hence, D is correct.
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:
Process Arrival Time Burst Time
P1 0 5
P2 1 1
P3 3 3
P4 4 x
If the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?
If we take value of x is 2, then we have gantt chart as
So, completion time of P1, P2, P3, and P4 are 6, 2, 11, and 8 respectively. Turn around time of P1, P2, P3, and P4 are 6, 1, 8, and 4 respectively. Waiting time of P1, P2, P3, and P4 are 1, 0, 5, and 2 resectively. Therefore, average waiting time = (1+0+5+2) / 4 = 8/2 = 2 Option (B) is correct.
Consider the following four processes with the arrival time and length of CPU burst given in milliseconds :
The average waiting time for preemptive SJF scheduling algorithm is __________.
First we will make gantt chart of given process then we will calculate turn around time and waiting time of individual process.
Now we have to calculate average waiting time for schedule:avg waiting time = wt(P1 + P2 + P3 + P4 )/number of process. ie.
(9 + 0 + 15 + 2) / 4
= 26 / 4
Which module gives control of the CPU to the process selected by the short - term schedular ?
There are three type of scheduler:
Dispatcher is responsible for handovering the control of CPU to the newly selected process by the Short-term scheduler. Refer: Process Scheduler So, option (A) is correct.
Which of the following scheduling algorithms may cause starvation ? a. First-come-first-served b. Round Robin c. Priority d. Shortest process next e. Shortest remaining time first
So, option (C) is correct.
Which of the following statement is true?
Jitter is the variation / displacement between the signals or data being sent. Hard real operating systems deal with more sensitive systems which require strict time deadlines like engine control systems, satellite launching systems etc while soft real operating systems do not require strict timing constraints and a bit delay is permissible, like mobile phones, online database systems. So hard real operating systems require minimised jitter.
Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).
There are 3 context switch. So. option (A) is correct.
Five jobs A, B, C, D and E are waiting in Ready Queue. Their expected runtimes are 9, 6, 3, 5 and x respectively. All jobs entered in Ready queue at time zero. They must run in _____ order to minimize average response time if 3 < x < 5.
We will solve it by minimizing the avg Waiting Time and Take x = 4 BT = Burst or Execution time CT = completion time P = Process AWT = Average Waiting Time AT = Arrival time WT = Waiting time
We get minimum average waiting time from the sequence given in option (B)
Which of the following is not an optimization criterion in the design of a CPU scheduling algorithm?
Minimum CPU utilization is not an optimization criterion as various optimization techniques and scheduling algorithms are used to bring the best CPU performance.
Below is the precedence graph for a set of tasks to be executed on a parallel processing system S.
What is the efficiency of this precedence graph on S if each of the tasks T1, T2, T3,....T8 takes the same time and the system S has five processors?
It can be seen that along with the sequential execution of T1 and T2, (T3, T6), (T4, T7) and (T5, T8), all these three processes can be executed in parallel. So total number of processes that can be executed in 4 units time using 5 available processors = 5*4 = 20 But here processes that are executing in 4 units time = 8 Throughput = 8/20 * 100 = 40% So, option (B) is correct.
A scheduling Algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (lowest priority). The scheduler reevaluates the process priority for every ‘T’ time units and decides next process to be scheduled. If the process have no I/O operations and all arrive at time zero, then the scheduler implements _________ criteria.
A scheduling Algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (lowest priority). The scheduler reevaluates the process priority for every ‘T’ time units and decides next process to be scheduled. If the process have no I/O operations and all arrive at time zero, then the scheduler implements Round Robin Scheduling criteria. So, option (B) is correct.
In a system using single processor, a new process arrives at the rate of six processes per minute and each such process requires seven seconds of service time. What is the CPU utilization?
Number of processes per minute = 6 Burst time of each process = 7 secs
CPU utilization time within a minute = 6*7 = 42 secs
% CPU utilization = useful time / total time * 100
= (42/60) * 100
Option (A) is correct.
Consider the following justifications for commonly using the two-level CPU scheduling: I. It is used when memory is too small to hold all the ready processes. II. Because its performance is same as that of the FIFO. III. Because it facilitates putting some set of processes into memory and a choice is made from that. IV. Because it does not allow to adjust the set of in-core processes. Which of the following is true ?
The two-level CPU scheduling is used when memory is too small to hold all the ready processes because it facilitates putting some set of processes into memory and a choice is made from that. So, option (D) is correct.
Which of the following statements is not true for Multi Level Feedback Queue processor scheduling algorithm?
For Multi Level Feedback Queue processor scheduling algorithm:
In which of the following scheduling criteria, context switching will never take place ?
In Non - preemptive algorithms context switching will never take place because it doesn't allow to switch the process until it is completed fully. So, option (C) is correct.