CPU Scheduling Algorithms Quiz

SmartestVorticism avatar
SmartestVorticism
·
·
Download

Start Quiz

Study Flashcards

11 Questions

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?

The allocation of CPU to the process

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

Context switching occurs

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

Turnaround time

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

To keep the CPU as busy as possible

Which CPU scheduling algorithm is characterized by the convoy effect?

First Come First Serve

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

Turnaround time - burst time

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

Multiprogramming

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

The process having the smallest burst time is chosen for execution

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

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.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser