What is a process?
A process is a program that is running. It includes the program code, current activity, and resources it needs.
A program and a process are the same thing. (True/False)
False. A program is just instructions on disk. A process is that program running in memory.
What are the 4 main parts of a process’s memory?
1) Text = code, 2) Data = global variables, 3) Heap = dynamic memory, 4) Stack = local variables & function calls.
What are the 5 main process states?
New, Ready, Running, Waiting (Blocked), Terminated.
The __________ contains all important information about a process.
PCB (Process Control Block).
What does the PCB store?
Process state, program counter, CPU registers, scheduling info, memory info, and I/O info.
What is a context switch?
When the CPU saves the state of one process and loads another so it can switch tasks.
Context switching is free and has no performance cost. (True/False)
False. Switching takes time, so it adds overhead.
What are the three types of schedulers?
Long-term (admit jobs), Short-term (choose next CPU job), Medium-term (pause/resume jobs).
What does the long-term scheduler do?
Decides which jobs enter the system and controls how many processes are in memory.
What does the short-term scheduler do?
Chooses which process in the ready queue runs on the CPU next.
What does the medium-term scheduler do?
Temporarily stops and later resumes processes to balance system performance.
Why balance CPU-bound and I/O-bound processes?
To keep both CPU and devices busy, improving efficiency.
Which process spends more time waiting for I/O?
I/O-bound process.
A process that mostly uses the CPU is called __________.
CPU-bound process.
What is the difference between a zombie process and an orphan process?
Zombie = finished but parent didn’t collect it. Orphan = parent ended while child is still running.
A zombie process is still running. (True/False)
False. It has finished but hasn’t been fully removed yet.
What is multiprogramming?
Having multiple processes in memory so CPU always has work to do.
What is the ready queue?
A list of processes waiting for CPU time.
What is the waiting queue?
A list of processes waiting for I/O or some event.
What does the degree of multiprogramming mean?
The number of processes in memory at once.
What causes a context switch?
Things like interrupts, I/O finishing, or the scheduler picking another process.
Which OS data structure keeps track of processes?
PCB (Process Control Block).
What is process termination?
When a process finishes or is killed, and its resources are freed.