CS FundamentalsHardGATE CS
A spooler is used for a printer. Which deadlock condition does spooling break for the printer resource, and how?
- A. Circular wait, by numbering printers
- B. No preemption, by taking the printer away
- C. Mutual exclusion: processes write to a spool area on disk and only the spooler daemon uses the printer itself
- D. Hold and wait, by requesting all resources at once
Correct answer: C. Mutual exclusion: processes write to a spool area on disk and only the spooler daemon uses the printer itself
With spooling no user process ever holds the physical printer; each just writes a file. Only the daemon accesses the device, so the printer is never contended among processes. (Spool space itself can still run out.)
More Operating Systems questions
- Semaphores s = 2, t = 0. Process X runs repeat 2 times { wait(s); print('A'); signal(t); } and Y runs repeat 2 times { wait(t)…
- Shared x = 0. Three threads each execute x = x + 1; once (load, add, store; no locking). What is the set of possible final values?
- Shared x = 0. Thread A executes x = x + 1; twice and thread B executes x = x - 1; twice, with no synchronisation (each statement is load…
- Semaphores a = b = c = 0. P1: print A; signal(a); wait(b); wait(c); print X. P2: print B; signal(b); signal(b); wait(a); print Y. P3…
- Semaphore s = 0. P1: print('a'); signal(s); print('b'). P2: wait(s); print('c'); print('d'). How many different output strings are possible?
- Binary semaphores S = Q = 1. P1: wait(S); wait(Q); print 1; signal(Q); signal(S). P2: wait(Q); wait(S); print 2; signal(S); signal(Q)…