Operating systems miscellaneous
- List I contains some CPU scheduling algorithms and List II contains some applications. Match entries in List I to entries in List II using the codes given below the lists.
Codes
-
View Hint View Answer Discuss in Forum
The correct matching is shown
Correct Option: A
The correct matching is shown
- Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation.
II. Pre-emptive scheduling may cause starvation.
II. Pre-emptive scheduling may cause starvation.
III. Round robin is better than FCFS in terms of response time
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
NA
- Consider the following table of arrival time and burst time for three processes P0, P1 and P2.
Process Arrival time Burst time P0 0 ms 9 ms P1 1 ms 4 ms P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
-
View Hint View Answer Discuss in Forum
Process P0 is allocated processor at 0 ms as there is no other process in ready queue. P0 is preempted after 1 ms as P1 arrives at 1 ms and burst time for P1 is less than remaining time of P0. P1 runs for 4ms. P2 arrived at 2 ms but P1 continued as burst time of P2 is longer than P1. After P1 completes, P0 is scheduled again as the remaining time for P0 is less than the burst time of P2. P0 waits for 4 ms, P1 waits for 0 ms amd P2 waits for 11 ms. So average waiting time is (0 + 4 + 11) / 3 = 5.
Correct Option: A
Process P0 is allocated processor at 0 ms as there is no other process in ready queue. P0 is preempted after 1 ms as P1 arrives at 1 ms and burst time for P1 is less than remaining time of P0. P1 runs for 4ms. P2 arrived at 2 ms but P1 continued as burst time of P2 is longer than P1. After P1 completes, P0 is scheduled again as the remaining time for P0 is less than the burst time of P2. P0 waits for 4 ms, P1 waits for 0 ms amd P2 waits for 11 ms. So average waiting time is (0 + 4 + 11) / 3 = 5.
- Consider the 3 processes, P1, P2 and P3 shown in the table :
The completion order of the 3 processes under the policies FCFS and RR2 (Round Robin scheduling with CPU quantum 2 time units) are
-
View Hint View Answer Discuss in Forum
Order P1 → P2 → P3
Round robin Here, not P2 because in the ready queue P2 comes later than P3.
Here, not P3 because in the ready queue P1 comes first than P3.
Order P1 → P3 → P2Correct Option: C
Order P1 → P2 → P3
Round robin Here, not P2 because in the ready queue P2 comes later than P3.
Here, not P3 because in the ready queue P1 comes first than P3.
Order P1 → P3 → P2
- A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler reevaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
-
View Hint View Answer Discuss in Forum
Process scheduling is independent of the time it takes for a process to execute. Thus, shortest-jobfirst algorithm and shortest remaining-time-first algorithm can be discarded (i.e., option c and d) Initially as all the processes arrive simultaneously the waiting time for each process = 0
Any of the processes can be scheduled first say P1. Since, the scheduler re-evaluates the process priorities every T time units. After T units of time, Waiting time of P1 = 0 and waiting time of all the others = T.
Thus, in priority all other processes supersede P1 and hence other processes get scheduled thereafter. Once, every process gets scheduled one time each for T time units all the processes will have same waiting time i.e., (n – 1)T, where n is the process number.
On the basis of analysis this is Round Robin with preemptions at periods of T.
Option (a) is incorrect because scheduling is independent of the arrival time of the processor.Correct Option: B
Process scheduling is independent of the time it takes for a process to execute. Thus, shortest-jobfirst algorithm and shortest remaining-time-first algorithm can be discarded (i.e., option c and d) Initially as all the processes arrive simultaneously the waiting time for each process = 0
Any of the processes can be scheduled first say P1. Since, the scheduler re-evaluates the process priorities every T time units. After T units of time, Waiting time of P1 = 0 and waiting time of all the others = T.
Thus, in priority all other processes supersede P1 and hence other processes get scheduled thereafter. Once, every process gets scheduled one time each for T time units all the processes will have same waiting time i.e., (n – 1)T, where n is the process number.
On the basis of analysis this is Round Robin with preemptions at periods of T.
Option (a) is incorrect because scheduling is independent of the arrival time of the processor.