Процес (Process)
Екземпляр комп'ютерної програми, що виконується, маючи власний ізольований адресний простір.
A process is an active entity in an operating system. It consists of the program code, its current activity (tracked by the program counter), and a set of resources (memory address space, file descriptors, etc.). Processes are isolated from each other by the OS to ensure system stability and security.
graph LR
Center["Процес (Process)"]:::main
Rel_multiprocessing["multiprocessing"]:::related -.-> Center
click Rel_multiprocessing "/terms/multiprocessing"
Rel_algorithms["algorithms"]:::related -.-> Center
click Rel_algorithms "/terms/algorithms"
Rel_pipelining["pipelining"]:::related -.-> Center
click Rel_pipelining "/terms/pipelining"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Перевірка знань
🧒 Простими словами
Програма — це рецепт у кулінарній книзі (пасивний, просто текст). Процес — це власне приготування страви за цим рецептом (активний, відбувається зараз). Якщо ви готуєте дві однакові страви одночасно — це два різних процеси, хоча рецепт (програма) один.
🤓 Expert Deep Dive
У UNIX-подібних системах нові процеси створюються системним викликом fork(), який робить копію батьківського процесу (часто з використанням Copy-on-Write для оптимізації), а потім exec() замінює образ пам'яті новою програмою. Процеси ізольовані, тому для спілкування потрібен IPC (Inter-Process Communication): пайпи, сокети, черги повідомлень або спільна пам'ять.