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