- Process = program in execution. Parts: text (code), data (globals), heap (dynamic), stack (calls, locals), plus program counter and registers.
- Memory layout from low to high: text, data, heap (grows up) … stack (grows down).
🎯 How this can come up · 1 question
Local variables and return addresses are stored in the process’s:
Correct: Stack.
- States: new, ready, running, waiting, terminated.
- Transitions: ready → running (dispatch), running → ready (interrupt), running → waiting (I/O or event wait), waiting → ready (I/O done).
🎯 How this can come up · 1 question
When a process’s I/O completes, it moves from waiting to:
Correct: Ready.
- PCB (task control block) stores state, program counter, registers, scheduling, memory-management, accounting and I/O status info.
🎯 How this can come up · 1 question
Which is NOT stored in a PCB?
Correct: The program’s source code.
- Ready queue: processes in memory waiting for the CPU. Wait queues: waiting for an event or device.
- Short-term (CPU) scheduler: picks the next ready process, runs very often. Long-term (job) scheduler: controls the degree of multiprogramming.
🎯 How this can come up · 1 question
The scheduler that controls the degree of multiprogramming is the:
Correct: Long-term scheduler.
- Medium-term scheduler: swaps processes out of memory and back in to reduce the degree of multiprogramming.
- I/O-bound processes: many short CPU bursts. CPU-bound: few long bursts. A good mix keeps both CPU and devices busy.
- Context switch: save the old process’s state into its PCB and load the new one’s. Pure overhead: no useful work is done.
🎯 How this can come up · 1 question
During a context switch the system does useful work for the processes.
False. It is overhead.
- Parent creates children → a tree of processes (identified by pid). Parent and child may share all, some or no resources; parent may wait or run concurrently.
- UNIX: fork() makes a copy of the parent; exec() replaces the child’s memory with a new program; wait() lets the parent wait.
🎯 How this can come up · 1 question
After fork(), the return value in the child process is:
The parent receives the child’s pid; −1 means failure.
- exit() ends a process; the parent collects the status with wait(). Zombie: terminated but parent hasn’t called wait(). Orphan: parent ended without waiting.
🎯 How this can come up · 1 question
A process that has terminated but whose parent has not yet called wait() is a:
Correct: Zombie.
- Independent vs. cooperating processes. Cooperation reasons: information sharing, computation speed-up, modularity, convenience.
- Two IPC models: shared memory (fast, processes synchronize themselves) and message passing (kernel involved, easier for small data and distributed systems).
🎯 How this can come up · 1 question
Which IPC model is usually faster once set up?
No system call per exchange after the region is set up.
- Producer–consumer: producer fills a buffer, consumer empties it. Unbounded vs. bounded buffer.
- Circular bounded buffer: in = next free slot, out = first full slot. Empty when in out; full when (in + 1) % SIZE out, so only SIZE − 1 items fit.
🎯 How this can come up · 1 question
With the in/out bounded-buffer solution and BUFFER_SIZE = 10, at most how many items can be in the buffer?
One slot stays empty to tell full from empty.
- Adding a count variable lets all slots be used, but count++ / count-- then need synchronization (race condition → Ch 6).
- Message passing: send(message) and receive(message) over a communication link.
- Direct communication: name the process explicitly (send(P, msg)); one link per pair.
- Indirect communication: send to / receive from a mailbox (port); a link can join many processes.
🎯 How this can come up · 1 question
In indirect communication, messages are sent to:
Correct: A mailbox (port).
- Blocking (synchronous) vs. non-blocking (asynchronous) send and receive. Blocking send + blocking receive = rendezvous.
No slides match this filter.















































