CS FundamentalsModerateGATE CS
Two processes each need two printers, and the system has exactly 3 printers; each requests its printers one at a time and holds them until done. Can the system deadlock?
- A. Yes, if each holds one printer and then waits for its second
- B. Yes, but only once a third process also asks for a printer
- C. No: one of them can always get its second printer
- D. No, but only because printer output is spooled to disk
Correct answer: C. No: one of them can always get its second printer
The worst case is each holding one printer, using 2 of 3, so the third is free and one of them gets it and finishes. Deadlock needs at least n(k − 1) + 1 = 2 × 1 + 1 = 3 printers to be impossible, and 3 meets that.
More Operating Systems questions
- A file system uses 4 KB blocks. A file of 10,001 bytes is stored. How much space is lost to internal fragmentation in its last block?
- Statement 1: A context switch between two threads of the same process need not flush the TLB. Statement 2: A context switch between two…
- A process's page table has valid entries for pages 0-5 only. With 1 KB pages, which logical address causes a trap instead of a translation?
- A machine has 46-bit virtual addresses, 16 KB pages and 4-byte page-table entries. Lower page-table levels are full 16 KB pages; the top…
- A machine has 48-bit virtual addresses, 4 KB pages and 4 GB of physical memory and uses a hashed inverted page table. Each IPT entry (one…
- A 3-level paging system has TLB lookup 20 ns and memory access 100 ns. On a TLB miss the three page-table levels are read from memory and…