🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Threads and Context Switching: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which of these does each thread of a process have its OWN copy of?
  2. Q2. In the Python demo, why did the list stay empty after the child process ran?
  3. Q3. In the many-to-one model, what happens when one user thread makes a blocking system call?
  4. Q4. Which threading model do Linux and Windows use for ordinary threads?
  5. Q5. Which step happens in a process switch but NOT in a switch between threads of the same process?
  6. Q6. Why do process switches often cause many TLB misses right afterwards?
  7. Q7. A context switch takes 5 µs and happens after every 1 ms of useful work. Roughly what fraction of CPU time is lost?
  8. Q8. What does this print? (code)
  9. Q9. In standard CPython, why do threads not speed up a pure calculation?
  10. Q10. Why does Chrome run each website in a separate process rather than a separate thread?