CPU Scheduling, Semaphores & Deadlock Banker’s Formula
TAT/WT numericals, counting semaphore wait/signal invariants, and minimum/maximum resource deadlock formulas.
Deadlock Resource Allocation Shortcut
Suppose processes each require at most instances of a single resource type :
- Maximum resources WITH deadlock still possible:
- Minimum resources GUARANTEEING NO deadlock:
Example: 4 processes each need max tape drives. Max drives with deadlock . Minimum drives for zero deadlock !
fork() System Call Process Creation
Calling fork() times sequentially creates total processes ( original parent + child processes).
🎯 Practice PYQs on This Topic (4)
A system has processes, and each process requires a maximum of instances of resource to complete execution. What is the minimum number of instances of that guarantees the system will NEVER enter deadlock?
A C program executes fork(); fork(); fork(); sequentially without any conditional branching. Including the initial parent process, how many child processes are newly created?
A counting semaphore is initialized to . Subsequently, wait(P) operations and signal(V) operations are completed on . What is the current value of ?
A system has processes, each requiring at most identical units of resource . What is the minimum number of units of that guarantees the system is always deadlock-free?