1/44
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is a program?
A passive entity, a collection of instructions and data stored on disk.
What is execution?
The act of the CPU reading and carrying out instructions from a program.
What is a CPU?
Central Processing Unit, the hardware that performs calculations and executes instructions.
What is memory (RAM)?
The computer's working space where active programs and data are stored for fast access by the CPU.
What is a process?
A program in execution; an active entity loaded into memory.
What are the four main components of a process?
Program (text) section, program counter (PC), stack, data section.
What is the program (text) section of a process?
The actual code (instructions) of the program being executed.
What is the program counter (PC)?
A register holding the memory address of the next instruction to be executed.
What is the stack in a process?
A region of memory for temporary data like function parameters, return addresses, and local variables.
What is the data section in a process?
A region of memory for global variables accessible by the entire program.
List the five process states.
New, ready, running, waiting, terminated.
What does the "new" state mean?
The process is being created; the OS is performing initial setup.
What does the "ready" state mean?
The process is loaded into memory and waiting to be assigned to a CPU.
What does the "running" state mean?
Instructions are being executed by the CPU.
What does the "waiting" state mean?
The process is waiting for some event (e.g., I/O) to occur.
What does the "terminated" state mean?
The process has finished execution.
On a single-core machine, how many processes can be in the running state at once?
Only one.
What is a Process Control Block (PCB)?
A kernel data structure that holds all information about a process; its "ID card".
What is stored in the PCB?
Process state, program counter, CPU registers, CPU scheduling info, memory-management info, accounting info, I/O status info.
What is the purpose of saving CPU registers in the PCB?
To allow the OS to restore the process's state when it resumes execution after a context switch.
What kind of accounting information might be in a PCB?
CPU time used, process ID (PID), time limits.
What is the purpose of memory-management information in a PCB?
Details about allocated memory, such as pointers to page tables or segment tables.
What does I/O status information in a PCB include?
A list of open files and devices used by the process.
What is a parent process?
A process that creates another process.
What is a child process?
A process created by a parent process.
What is a Process Identifier (PID)?
A unique number assigned to each process for identification and management.
What are three resource-sharing options when a parent creates a child?
1) Parent and children share all resources; 2) Children share a subset of parent's resources; 3) Parent and child share no resources.
What are two execution models for parent and child processes?
1) Parent and children execute concurrently; 2) Parent waits until children terminate.
What does the fork() system call do?
Creates a new process (child) that is an almost exact copy of the calling process (parent).
What does the exec() family of system calls do?
Replaces a process's memory space with a new program, often used after fork() to transform a child process.
Why is exec() typically called after fork()?
To allow the child process to run a different program from the parent.
How does a process normally terminate?
It executes its last statement and calls the exit() system call to ask the OS to delete it.
What happens when a process calls exit()?
Output data may be passed to parent via wait, and all resources are deallocated by the OS.
What is aborting a process?
When a parent forcibly terminates one of its child processes.
List reasons a parent might abort a child.
Child exceeded allocated resources, task is no longer required, or parent is exiting.
What is cascading termination?
Some operating systems terminate all children if the parent terminates, preventing orphaned processes.
What is a context switch?
The mechanism by which the OS switches the CPU from one process to another.
What happens during a context switch?
The system saves the state (e.g., registers, PC) of the old process into its PCB, and loads the saved state of the new process from its PCB.
What is overhead in the context of a context switch?
The time spent saving and restoring process states; the system does no useful work during the switch.
What does context switch time depend on?
Hardware support, specifically the number of registers that must be saved and restored.
Why are context switches considered costly?
They consume CPU cycles that could otherwise be used for executing user processes.
What is the difference between a program and a process?
A program is a passive file on disk; a process is an active instance of a program loaded into memory and executing.
How are processes managed by the operating system?
Through the use of process states, the Process Control Block (PCB), and scheduling.
What system calls are commonly used for process creation in UNIX?
fork() and exec().
What is the role of the wait() system call in process termination?
It allows a parent to collect output data from a child that has terminated.