CPU Scheduling Algorithms Quiz
11 Questions
5 Views
3.7 Stars

CPU Scheduling Algorithms Quiz

Test your knowledge of CPU scheduling algorithms, including First Come First Serve, Shortest Job First, Round Robin, Priority Scheduling, and more. Learn how to determine which process will own the CPU for execution and how tasks are assigned with priorities.

Created by
@SmartestVorticism

Questions and Answers

Which of the following CPU scheduling algorithms is an example of non-preemptive scheduling?

First Come First Serve (FCFS)

What is the main objective of CPU scheduling?

To determine which process will own the CPU for execution

Which of the following is not a type of CPU scheduling algorithm?

Memory Allocation

What is the difference between preemptive and non-preemptive scheduling?

<p>The allocation of CPU to the process</p> Signup and view all the answers

What happens when a process switches from the running to the waiting state?

<p>Context switching occurs</p> Signup and view all the answers

What is the term for the time taken by a process to complete its execution from its arrival time?

<p>Turnaround time</p> Signup and view all the answers

What is the primary goal of the operating system in terms of CPU utilization?

<p>To keep the CPU as busy as possible</p> Signup and view all the answers

Which CPU scheduling algorithm is characterized by the convoy effect?

<p>First Come First Serve</p> Signup and view all the answers

What is the formula to calculate the waiting time of a process?

<p>Turnaround time - burst time</p> Signup and view all the answers

What is the term for programs that can be present in the memory at the same time?

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

What is the characteristic of the Shortest Job First scheduling algorithm?

<p>The process having the smallest burst time is chosen for execution</p> Signup and view all the answers

Study Notes

Process Management

  • Process execution involves three states: running, waiting, and ready
  • Burst Time / Execution Time: time required to complete execution (running time)
  • Arrival Time: when a process enters the ready state
  • Finish Time: when a process completes and exits the system

Multiprogramming

  • Multiprogramming: multiple programs can be present in memory at the same time
  • Jobs: programs without user interaction
  • User: program with user interaction
  • Process: a reference used for both jobs and users

CPU Burst Cycle

  • CPU/IO Burst Cycle: characterizes process execution, alternating between CPU and I/O activity
  • CPU Utilization: the main task of the OS is to keep the CPU busy as possible
  • Throughput: the number of processes that finish their execution per unit of time

Performance Metrics

  • Waiting Time: the amount of time a process needs to wait in the ready queue
  • Response Time: the amount of time from submitting a request to the first response
  • Turnaround Time: the time taken to execute a specific process; Time taken to complete after arrival
  • Completion Time: time taken for execution to complete starting from arrival time
  • Calculations:
    • Turnaround Time = Completion Time - Arrival Time
    • Waiting Time = Turnaround Time - Burst Time

CPU Scheduling Algorithms

  • First Come First Serve (FCFS): the easiest and most simple CPU scheduling algorithm
  • Shortest Job First (SJF): the process having the smallest time is chosen for execution
  • Other algorithms:
    • Shortest Remaining Time First (SRTF)
    • Round Robin Scheduling (RR)
    • Priority Scheduling (Prio)
    • Preemptive Priority Scheduling (P-Prio)
    • Multi-level Queue Scheduling (MLQ)

Preemptive vs Non-Preemptive Scheduling

  • Preemptive Scheduling: tasks are assigned with priorities
  • Non-Preemptive Scheduling: CPU is allocated to a specific process which will release the CPU either by switching context or terminating
  • Differences:
    • Preemptive: a process switches from the running to the waiting state
    • Non-Preemptive: a process switches from the running state to the ready state

Studying That Suits You

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

Quiz Team

More Quizzes Like This

Use Quizgecko on...
Browser
Browser