PCB & Context Switching

2025. 8. 3. 01:08·Computer Science/Operating System

PCB (Process Control Block)

  • The Process Control Block (PCB) is a data structure used by the operating system to store *metadata about a process.
  • It is created by the OS when a process is generated.
  • The PCB contains all the essential information needed to manage and control the process.
  • Since it holds critical information, it is protected and maintained at the front of the kernel stack, inaccessible to regular users.

When a program is executed, a process is created and memory (stack, heap, etc.) is allocated based on the process's memory structure.

At the same time, the OS stores the process's metadata in its PCB.

 


What is *Metadata?

  • Metadata is structured data that describes other data.
  • It allows users or systems to efficiently locate and utilize specific information from a large dataset by providing standardized information about the content.

Context Switching

  • Context switching is the process of saving the current process’s PCB and loading another process’s PCB.
  • It occurs when:
    • The allocated CPU time for a process expires.
    • An interrupt happens (e.g., I/O or higher-priority task).

Even though it seems like the computer runs many processes simultaneously,

only one process is actually executed at a time on a single CPU.

It appears concurrent because context switching happens so quickly between processes.

 

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

Shared resources, Critical sections, and Deadlock  (0) 2025.08.23
Threads and Multithreading  (0) 2025.08.11
Process  (0) 2025.07.30
How memory manages data  (0) 2025.07.27
Memory  (0) 2025.07.25
'Computer Science/Operating System' 카테고리의 다른 글
  • Shared resources, Critical sections, and Deadlock
  • Threads and Multithreading
  • Process
  • How memory manages data
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
  • 블로그 메뉴

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

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

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
JTB
PCB & Context Switching
상단으로

티스토리툴바