CPU Scheduling Algorithms and Evaluation Criteria Quiz

GracefulMossAgate avatar
GracefulMossAgate
·
·
Download

Start Quiz

Study Flashcards

Questions and Answers

Which type of process spends more time doing I/O than computations and has many short CPU bursts?

I/O-bound process

What is the main concern when it comes to CPU burst distribution?

CPU utilization

Which scheduler selects which process should be executed next and allocated the CPU?

Short-term scheduler

Which scheduler selects which processes should be brought into the ready queue?

<p>Long-term scheduler</p> Signup and view all the answers

Which scheduler controls the degree of multiprogramming?

<p>Long-term scheduler</p> Signup and view all the answers

Which type of process spends more time doing computations and has few very long CPU bursts?

<p>CPU-bound process</p> Signup and view all the answers

Which scheduler is invoked frequently and must be fast?

<p>Short-term scheduler</p> Signup and view all the answers

Which scheduler is invoked infrequently and may be slow?

<p>Long-term scheduler</p> Signup and view all the answers

What is the objective of the long-term scheduler?

<p>To control the degree of multiprogramming</p> Signup and view all the answers

What is the objective of the short-term scheduler?

<p>To maximize CPU utilization</p> Signup and view all the answers

Which scheduling algorithm is considered fair but has a poor average waiting time?

<p>Round Robin</p> Signup and view all the answers

Which scheduling algorithm is not fair and has a poor average waiting time?

<p>FCFS</p> Signup and view all the answers

Which scheduling algorithm minimizes the average waiting time assuming accurate prediction of the next CPU burst length, but can lead to starvation?

<p>SJF</p> Signup and view all the answers

Which scheduling algorithm is an approximation of SJF and uses multiple queues?

<p>Multilevel Queuing</p> Signup and view all the answers

In SJF scheduling, what is the average waiting time for the following burst times: P1: 3, P2: 16, P3: 9, P4: 0?

<p>7</p> Signup and view all the answers

In preemptive SJF scheduling with varying arrival times, what is the average waiting time for the following burst times and arrival times: P1: 1 (arrival: 0), P2: 5 (arrival: 1), P3: 2 (arrival: 2), P4: 4 (arrival: 3)?

<p>6.5</p> Signup and view all the answers

In priority scheduling, which process will be executed first if the priority numbers are as follows: P1: 3, P2: 1, P3: 4, P4: 5, P5: 2?

<p>P2</p> Signup and view all the answers

In round robin scheduling with a time quantum of 4, what is the average waiting time for the following burst times: P1: 24, P2: 3, P3: 3?

<p>14</p> Signup and view all the answers

In round robin scheduling, if there are 4 processes and the time quantum is 5, how many time units will each process get at most?

<p>4</p> Signup and view all the answers

In round robin scheduling, what is the maximum waiting time for a process if there are 5 processes and the time quantum is 10?

<p>30</p> Signup and view all the answers

Which process scheduling algorithm aims to keep the CPU as busy as possible?

<p>Shortest-Job-First (SJF)</p> Signup and view all the answers

What is the waiting time for process P2 in the FCFS scheduling algorithm if the process burst times are P1=24, P2=3, P3=3 and the processes arrive in the order P1, P2, P3?

<p>24</p> Signup and view all the answers

Which scheduling algorithm is optimal and gives the minimum average waiting time for a given set of processes?

<p>Shortest-Job-First (SJF)</p> Signup and view all the answers

What is the context-switch time in an operating system?

<p>The time it takes for the CPU to switch to another process</p> Signup and view all the answers

Which scheduling decision is nonpreemptive?

<p>When a process terminates</p> Signup and view all the answers

What is the formula for calculating waiting time in nonpreemptive scheduling algorithms?

Signup and view all the answers

What is the formula for calculating turnaround time in preemptive scheduling algorithms?

<p>Turn Around Time = Completion Time - Arrival Time</p> Signup and view all the answers

What is the goal of CPU scheduling?

<p>Maximize CPU utilization</p> Signup and view all the answers

What is the average waiting time for the FCFS scheduling algorithm if the processes arrive in the order P2, P3, P1 and the process burst times are P1=24, P2=3, P3=3?

<p>6</p> Signup and view all the answers

Which scheduling algorithm may result in the convoy effect?

<p>First-Come, First-Served (FCFS)</p> Signup and view all the answers

Which type of process spends more time doing computations and has few very long CPU bursts?

<p>CPU-bound process</p> Signup and view all the answers

Which scheduler is invoked frequently and must be fast?

<p>Short-term scheduler</p> Signup and view all the answers

What is the formula for calculating turnaround time in preemptive scheduling algorithms?

<p>Turnaround time = Waiting time + Burst time</p> Signup and view all the answers

Which process scheduling algorithm aims to keep the CPU as busy as possible?

<p>Shortest-Job-First (SJF) Scheduling</p> Signup and view all the answers

What is the formula for calculating waiting time in nonpreemptive scheduling algorithms?

<p>Waiting Time = Turnaround Time - Burst Time</p> Signup and view all the answers

Which scheduling algorithm minimizes the average waiting time assuming accurate prediction of the next CPU burst length, but can lead to starvation?

<p>Shortest-Job-First (SJF) Scheduling</p> Signup and view all the answers

Which scheduler controls the degree of multiprogramming?

<p>Medium-term Scheduler</p> Signup and view all the answers

Which scheduling algorithm is considered fair but has a poor average waiting time?

<p>Round Robin</p> Signup and view all the answers

What is the average waiting time for the FCFS scheduling algorithm if the processes arrive in the order P2, P3, P1 and the process burst times are P1=24, P2=3, P3=3?

<p>15</p> Signup and view all the answers

What is the average waiting time for the following burst times in SJF scheduling: P1: 3, P2: 16, P3: 9, P4: 0?

<p>12</p> Signup and view all the answers

In round robin scheduling with a time quantum of 4, what is the average waiting time for the following burst times: P1: 24, P2: 3, P3: 3?

<p>12</p> Signup and view all the answers

Study Notes

Process Scheduling

  • I/O-bound processes spend more time doing I/O than computations and have many short CPU bursts.
  • CPU-bound processes spend more time doing computations and have few very long CPU bursts.

Schedulers

  • Short-term scheduler selects which process should be executed next and allocated the CPU.
  • Long-term scheduler selects which processes should be brought into the ready queue.
  • Medium-term scheduler controls the degree of multiprogramming.

Scheduling Algorithms

  • Short-term scheduler is invoked frequently and must be fast.
  • Long-term scheduler is invoked infrequently and may be slow.
  • The objective of the long-term scheduler is to control the degree of multiprogramming.
  • The objective of the short-term scheduler is to select which process should be executed next.

Scheduling Algorithms' Properties

  • First Come First Served (FCFS) is not optimal and can result in convoy effect.
  • Shortest Job First (SJF) minimizes the average waiting time assuming accurate prediction of the next CPU burst length, but can lead to starvation.
  • Priority scheduling is not fair and has a poor average waiting time.
  • Round Robin (RR) is an approximation of SJF and uses multiple queues.
  • Multilevel Feedback Queue (MFQ) aims to keep the CPU as busy as possible.

Calculating Waiting Time and Turnaround Time

  • The formula for calculating waiting time in nonpreemptive scheduling algorithms is: Waiting Time = Burst Time of Previous Process.
  • The formula for calculating turnaround time in preemptive scheduling algorithms is: Turnaround Time = Burst Time + Waiting Time.

Scheduling Goals

  • The goal of CPU scheduling is to minimize the average waiting time.

Specific Scheduling Scenarios

  • In SJF scheduling, the average waiting time for burst times P1: 3, P2: 16, P3: 9, P4: 0 is 11.
  • In preemptive SJF scheduling with varying arrival times, the average waiting time for burst times P1: 1 (arrival: 0), P2: 5 (arrival: 1), P3: 2 (arrival: 2), P4: 4 (arrival: 3) is 4.
  • In priority scheduling, the process with the highest priority number will be executed first.
  • In round robin scheduling with a time quantum of 4, the average waiting time for burst times P1: 24, P2: 3, P3: 3 is 10.
  • In round robin scheduling, if there are 4 processes and the time quantum is 5, each process will get at most 5 time units.
  • In round robin scheduling, the maximum waiting time for a process if there are 5 processes and the time quantum is 10 is 40.
  • The waiting time for process P2 in the FCFS scheduling algorithm if the process burst times are P1=24, P2=3, P3=3 and the processes arrive in the order P1, P2, P3 is 27.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Quizzes Like This

CPU Scheduling Algorithms Quiz
15 questions
CPU Scheduling and Algorithms Quiz
10 questions
CPU Scheduling Metrics Quiz
30 questions
Use Quizgecko on...
Browser
Browser