Structure of CPU scheduling algorithm and each algorithm

2025. 8. 29. 06:45·Computer Science/Operating System

CPU Scheduler

The CPU scheduler assigns CPU time to threads (units of work) from processes according to a scheduling algorithm.

These algorithms aim to:

  • Maximize CPU utilization
  • Maximize the amount of work done in a given time
  • Minimize the number of processes in the ready queue
  • Minimize response time

 


Non-Preemptive Scheduling

In non-preemptive scheduling, a process voluntarily releases the CPU;

the OS does not forcibly stop it.

This results in less overhead from context switching.

  • FCFS (First Come, First Served)
    • Processes are handled in the order they arrive.
    • Drawback: long jobs can cause others to wait too long (convoy effect).
  • SJF (Shortest Job First)
    • The process with the shortest estimated execution time runs first.
    • Achieves the shortest average waiting time, but long jobs may starve.
    • Actual execution time is unknown, so estimates are based on past data.
  • Priority Scheduling
    • Assigns priorities to processes.
    • To prevent starvation of low-priority (long) jobs, aging is used — increasing a process's priority the longer it waits.

Preemptive Scheduling

Preemptive scheduling (used by modern OSs) forcibly interrupts the running process

and assigns the CPU to another process according to the algorithm.

  • Round Robin (RR)
    • Each process gets a fixed time slice.
    • If it doesn’t finish within its time slice, it goes to the back of the ready queue.
  • SRF (Shortest Remaining Time First)
    • A preemptive version of SJF.
    • If a process with a shorter remaining time arrives, it interrupts the current process and runs first.
  • Multilevel Queue
    • Multiple ready queues, each with its own scheduling algorithm (e.g., RR, FCFS).
    • Processes are assigned to queues based on priority.
    • Processes do not move between queues — less flexible but less overhead.

'Computer Science > Operating System' 카테고리의 다른 글

Shared resources, Critical sections, and Deadlock  (0) 2025.08.23
Threads and Multithreading  (0) 2025.08.11
PCB & Context Switching  (0) 2025.08.03
Process  (0) 2025.07.30
How memory manages data  (0) 2025.07.27
'Computer Science/Operating System' 카테고리의 다른 글
  • Shared resources, Critical sections, and Deadlock
  • Threads and Multithreading
  • PCB & Context Switching
  • Process
JTB
JTB
웹/앱 개발 정보를 공유하고 있습니다.
  • JTB
    JTechBlog
    JTB
  • 전체
    오늘
    어제
    • All About Programming;) N
      • Computer Science
        • Terminology and Concepts
        • Network
        • Operating System
        • Database
        • Data Structure
      • Frontend
        • Javascript Essentials
        • Perfomance Optimization
        • JS Patterns
        • Next.js
        • Flutter
      • Backend
        • Node.js
      • DevOps
        • Docker & Kubernetes
      • Coding Test N
        • LeetCode N
        • Programmers
      • Tech Books & Lectures
        • Javascript_Modern JS Deep d..
        • Network_IT 엔지니어를 위한 네트워크 입문
      • Projects
        • PolyLingo_2025
        • Build Your Body_2024
        • JStargram_2021
        • Covid19 Tracker_2021
        • JPortfolio_2021
      • BootCamp_Codestates
        • TIL
        • TILookCloser
        • Pre Tech Blog
        • IM Tech Blog
        • Daily Issues and DeBugging
        • First Project
        • Final Project
        • Sprint Review
        • Good to Know
        • Socrative Review
        • HTML & CSS
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 글쓰기
    • 관리
  • 공지사항

  • 인기 글

  • 태그

    JavaScript
    Operating System
    polylingo
    이벤트
    need a database
    testing
    스코프
    CPU scheduling algorithm
    모던 자바스크립트 Deep Dive
    Data Structure
    Network
    mobile app
    Binary Tree BFS
    indie hacker
    Shared resources
    자바스크립트
    VoiceJournal
    How memory manage data
    딥다이브
    프론트엔드 성능 최적화 가이드
    DOM
    Threads and Multithreading
    database
    TCP/IP
    자바스크립트 딥다이브
    js pattern
    structure of os
    커리어
    Time complexity and Space complexity
    leetcode
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
JTB
Structure of CPU scheduling algorithm and each algorithm
상단으로

티스토리툴바