Question 148: If shortest job first policy is used without pre-emption, what would be the average waiting time?
Options:
- 2
- 3
- 4
- 5
Solution: The correct answer is the third one. Average waiting time is (0 + 6 + 3 + 7)/4 = 4
Question 70: In priority based scheduling, what is the solution to starvation?
Solution: Aging refers to the technique of increasing the priority of the processes that wait in the ready queue for a long time. The correct answer is C.
Question #22: Which of the following is not a scheduling goal for batch systems?
Options:
Solution:
Response time means getting the response to requests quickly, this is a concern for interactive systems, or game/video playing applications. Batch systems concern with keeping the system busy and fully utilized at all times. Hence, the correct answer is option 3, response time.
An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times & execution times for the following processes:
Process Execution time Arrival time
P1 20 0
P2 25 15
P3 10 30
P4 15 45
Question #2: What is the total waiting time for process P2?
Solution: Following will be the timeline based on the SRT algorithm.
|—-P1—-|—-P1—-|—-P2—-|—-P3—-|—-P2—-|—-P2—-|—-P4—-|
0 15 20 30 40 45 55 70
P2 entered into the system at 15 and finished off at 55. The total time it stayed in the system is 55-15 = 40 and its execution time is 25. Hence, it waited for a total of 40-25 = 15 time units. Hence option 4th is the correct one.