274 字
1 分钟
cpu_scheduling

cpu_scheduling-1784049668912 cpu_scheduling-1784049815339 when a program is executed, it becomes a process and the operating system reserves a memory block for it. within this block, there’s a memory segment called the text section which contains the executable code for the program. cpu_scheduling-1784049895199 we know that the cpu contains a special register called the address register, also known as the program counter. this register points to the next instruction to be executed. cpu_scheduling-1784050437099 but remember that what enters the queue isn’t actually a process, but its process control block.

but many applications such as servers or background services are designed to run indefinitely. if we allocate the cpu to a process that never ends, all subsequent processes would be indefinitely waiting in the queue. if we assume that a process can only get the cpu fact is that programs in execution don’t use the cpu continuously.

eventually the final cpu burst ends with a system request to terminate execution. cpu_scheduling-1784050656308 cpu_scheduling-1784050697656 the scheduler should allocate it only until the process’s current cpu burst ends. cpu_scheduling-1784051033396 so even though it is now ready to continue running, it must wait for its turn.for most of their lifetime, processes cycle between these three states: ready, running, and waiting. cpu_scheduling-1784051335794 after making a system call to exit, the operating system must free allocated resources, including memory. cpu_scheduling-1784051506060 dispatcher.when a running process enters an io waiting state and the cpu becomes available the dispatcher steps in with one single purpose.allocate the cpu to the process at the head of the ready q. in other words, perform the context switch.

cpu_scheduling
https://sanzenin.top/posts/obsidian/cpu-scheduling/
作者
Sanzenin 凪
发布于
2026-07-14
许可协议
CC BY-NC-SA 4.0

分享文章

生成精美分享图或复制链接,与更多人分享本文。

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取

最后更新于 ,距今已过 125 天

部分内容可能已过时