What is a process?
A process is a running instance of a program, with its own execution state and the resources needed to run.
Study 2 Processes and Interprocess Communication with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a process?
A process is a running instance of a program, with its own execution state and the resources needed to run.
What information does the operating system track for a process?
The operating system tracks information such as its process identifier, current instruction and CPU context, memory, and open resources.
How do ready and blocked process states differ?
A ready process can run but is waiting for CPU time. A blocked process cannot continue until an event occurs, such as input arriving.
What does the scheduler do with ready processes?
The scheduler selects a ready process to run. When its time slice ends, it may return to the ready state.
What does `fork()` do?
In Unix-like systems, `fork()` creates a child process. The parent and child continue from the call, and the child receives a distinct process identifier.
What happens when a process calls an `exec` function?
An `exec` function replaces the process's current program image with a different program; the process itself continues to exist.
Why might a parent call `wait()` or `waitpid()`?
A parent can use `wait()` or `waitpid()` to collect a terminated child's exit status; waiting also lets the operating system release remaining bookkeeping.
Why do processes use interprocess communication?
Interprocess communication (IPC) provides controlled ways for processes to exchange data or coordinate activity because processes are normally isolated from one another's private memory.
What is a pipe used for in interprocess communication?
A pipe is a byte stream with a read end and a write end, often used between related processes. A shell pipeline can connect one process's output to another's input.
How does shared-memory IPC work, and what coordination does it require?
Processes map the same memory region into their address spaces and exchange data by reading and writing it. They need synchronization, such as semaphores, to avoid conflicting updates.
How does a process differ from a program?
A program is passive code stored on a device; a process is that code in execution.
How does Linux initially handle a child process's memory after `fork()`?
On Linux, a child created by `fork()` initially uses copy-on-write memory rather than immediately copying every memory page.