CS FundamentalsModerateGATE CS · TCS NQT
A program uses user-level threads mapped many-to-one onto a single kernel thread. One thread calls a blocking read() on a slow device. What happens, and what does the one-to-one model change?
- A. Only the calling thread blocks in both models
- B. The whole process blocks, because the kernel sees one schedulable entity; one-to-one lets the other threads keep running
- C. The library automatically converts read() into a non-blocking call in both models
- D. The kernel moves the other user threads to another CPU
Correct answer: B. The whole process blocks, because the kernel sees one schedulable entity; one-to-one lets the other threads keep running
The kernel knows nothing about user-level threads, so blocking the only kernel thread blocks them all. With one kernel thread per user thread, the others stay runnable and can also run in parallel on several CPUs.
More Operating Systems questions
- A bounded-buffer producer is written as wait(mutex); wait(empty); add item; signal(mutex); signal(full); while the consumer is the usual…
- Which statement about Belady's anomaly is correct?
- A machine has 32 GB of physical memory, 4 KB frames and an inverted page table with 8-byte entries. How big is the table, and why is a…
- Which statements are correct? 1. A child that has exited but whose parent has not called wait() is a zombie. 2. A zombie still holds its…
- The reference string at times 1–12 is 3, 5, 3, 8, 2, 5, 5, 9, 3, 9, 2, 2. With a working-set window Δ = 5 references, what are the…
- A device delivers data at 2 MB/s. Per-byte interrupts would cost 5 µs each; instead DMA moves 4 KB blocks and raises one interrupt per…