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;)
      • Computer Science
        • Terminology and Concepts
        • Network
        • Operating System
        • Database
        • Data Structure
        • Web Development
      • Frontend
        • Javascript Essentials
        • Perfomance Optimization
        • JS Patterns
        • React
        • Next.js
        • Flutter
        • Testing
      • Backend
        • Node.js
      • DevOps
        • Docker & Kubernetes
      • Coding Test
        • LeetCode
        • 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
  • 블로그 메뉴

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

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

  • 인기 글

  • 태그

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

  • 최근 글

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

티스토리툴바