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 |