CS FundamentalsHardGATE CS
Priority-based preemptive scheduling with L (low), M (medium), H (high). L arrives at t=0 and needs 10 units; at t=1 L locks a mutex and holds it for 5 units of its own execution. M arrives at t=2 and needs 6 units (no lock). H arrives at t=3, needs 4 units and requests the mutex as its first action. Ignoring switch cost, at what times does H finish without and with priority inheritance respectively?
- A. 16 and 7
- B. 12 and 11
- C. 14 and 7
- D. 16 and 11
Correct answer: D. 16 and 11
Without inheritance M (which does not need the lock) runs 3-8 ahead of L, L finishes its critical section during 8-12, and H runs 12-16. With inheritance L runs at H's priority from t=3, releases at t=7, and H runs 7-11.
More Operating Systems questions
- A C program runs: int i; for(i=0;i<4;i++){ if(fork()==0 && i%2==0) break; } printf("X"); Every process, including the original, reaches…
- Banker's algorithm with 3 resource types. Available = (1,1,1). Allocation rows P0..P3: (1,0,1), (0,2,0), (2,1,0), (1,1,1); Maximum rows…
- A disk has cylinders 0-199. The head is at cylinder 50 moving towards higher numbers. Pending requests: 176, 79, 34, 60, 92, 11, 41, 114…
- A 1024 KB buddy system (minimum block 32 KB, lowest-address-first allocation) serves A=70 KB, B=35 KB, C=80 KB, D=60 KB in that order…
- A system uses the clock (second-chance) page replacement with 4 frames. Initially all frames are empty; a page has its reference bit set…
- Memory access takes 200 ns. A page fault on a clean victim takes 8 ms to service and on a dirty victim 20 ms; 40% of victims are dirty…