module 2 Flashcards
Q26-2: How is the Gantt chart built in FCFS?
Order processes strictly by arrival time and run each to completion before the next.
Q15-6: How does the PCB track I/O status?
It keeps track of I/O devices assigned to the process and the status of pending I/O requests.
Q19-6: How do processes synchronize in IPC?
They use semaphores, mutexes, condition variables, or blocking message calls.
Q26-3: Why can FCFS lead to the convoy effect?
Long processes arriving first can delay all shorter processes behind them, increasing waiting times.
Q23-4: What is bounded waiting?
There must be a limit on the number of times other processes can enter their critical sections before a waiting process gets a turn.
Q23-6: Give an example of a race condition.
Two processes incrementing a shared counter simultaneously could overwrite each other’s updates if not synchronized.
Q17-1: What is a process in an OS context?
A process is a program in execution, consisting of code, data, and its current state.
Q22-7: What are common pitfalls with semaphores?
Improper usage can cause deadlocks, starvation, or priority inversion if signals and waits are not carefully managed.
Q20-6: Which model is simpler to implement in distributed systems?
Message passing is simpler for distributed environments, as it doesn’t rely on shared physical memory.
Q28-3: How do we handle arrival times in non-preemptive SJF?
We pick the shortest job from the ready queue once the current job finishes; we only look at processes that have arrived.
Q17-5: What is the data section of a process?
It contains global variables and static data used by the program.
Q23-2: Why is mutual exclusion needed?
Without mutual exclusion, concurrent access can lead to inconsistent data or race conditions.
Q17-4: How is the execution state maintained?
Registers, program counter, and other CPU states define the current execution context.
Q27-1: What is Round Robin (RR) scheduling?
Round Robin uses a time quantum and cycles through processes in the ready queue, giving each a small CPU slice.
Q25-6: What is turnaround time?
Turnaround time is the total time from process arrival to its completion.
Q21-7: Why might a system have both schedulers?
Using both allows fine-grained control of CPU allocation (short-term) and overall workload balance (long-term).
Q20-4: Which model requires more synchronization?
Shared memory requires explicit synchronization to avoid race conditions.
Q28-7: Why do we need to estimate burst times?
Exact burst times may be unknown, so we rely on historical or predicted CPU usage for SJF.
Q23-5: How can we implement mutual exclusion?
Using locks, semaphores, monitors, or hardware instructions like Test-and-Set.
Q22-5: How do semaphores achieve mutual exclusion?
By ensuring only one process can decrement a binary semaphore to 0, blocking others from entering the critical section.