Q70: Starvation in priority based scheduling

Question 70: In priority based scheduling, what is the solution to starvation?

  1. Starvation can be controlled by setting priorities appropriately.
  2. Fairness
  3. Aging
  4. Starvation can’t be stopped.

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.

Q22: Scheduling goal for batch systems

Question #22: Which of the following is not a scheduling goal for batch systems?

Options:

  1. Throughput
  2. CPU Utilization
  3. Response Time
  4. Turnaround Time

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.

Q2: Shortest Remaining Time First

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?

  • 5
  • 0
  • 10
  • 15

 

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.