Skip to content
TaeyoungKim.dev

Scheduling, Context Switching, Shell, Pipeline, and PCB

LinuxWritten 3 min readTaeyoungKim
LinkedInX

A shell interprets commands, and a pipeline sends one command's output to another command's input. Scheduling chooses work to run; context switching changes what the CPU runs and saves or restores execution context. Keeping command flow separate from process execution makes the PCB's role clearer.

Key terms

A scheduler selects runnable work. During a context switch, the operating system saves and restores execution state associated with processes or threads; the PCB holds important process information.

TermMeaning
SchedulingChoosing which task gets a resource such as CPU time, and in what order.
ShellA command interpreter that starts programs and provides features such as variables, redirection, and pipelines.
PipelineConnects the output of one command to the input of another, often with the shell's `
Utility programA program that helps operate, maintain, inspect, or configure a system.
macOSApple's current name for its Mac operating system, distinct from older “Mac OS” branding.

Terms to distinguish

TermMeaning
UNIXA family and historical lineage of multiuser operating systems originating at Bell Labs. The name can also have specific certification meanings in product contexts.
LinuxThe Linux kernel and, in common usage, operating-system distributions built around it. Linus Torvalds began developing the kernel in 1991.
DispatchHanding the CPU to a selected runnable process or thread so it can run.
Wake upMoving a waiting task toward a runnable state when its condition is met, such as I/O completion.
SpoolingQueueing work, often on disk, so a slower device or service can process it in order.

Terms in code

TermMeaning
Context switchingSaving enough state of one executing task and restoring another's so the CPU can switch between them.
Non-Preemptive schedulingA scheduling approach in which the scheduler does not forcibly take the CPU from a running task; the task yields or blocks.
Preemptive schedulingA scheduling approach in which the system can interrupt a running task and assign the CPU to another one.
PCBProcess Control Block: an operating-system data structure holding information needed to manage a process, including relevant execution state.

Reading a technical document

A shell connects commands through a pipeline. A context switch changes which task executes on the CPU and has state-management cost.

Find the subject and action first: a command can pass data through a pipe while the scheduler independently decides when its process runs. These are different kinds of flow.

Key takeaways

Separate task selection, execution switching, command connections, and process records.

  • Scheduling — Chooses which work gets a resource and when.
  • Dispatch — Gives the CPU to a selected runnable task.
  • PCB — Stores information the operating system needs to manage a process.

Author

TaeyoungKim

Connecting technical foundations with implementation, verification, and production decisions.

Read next