← All topics
Quiz: Threads, Processes and the GIL: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does the GIL do in CPython?
- Q2. A program downloads 100 web pages. Which tool gives the easiest big speed-up?
- Q3. A program does heavy maths on large lists in pure Python. Which tool can use all CPU cores?
- Q4. What is a race condition?
- Q5. What does this print? (code)
- Q6. Does the GIL make balance = balance + 100 safe across threads?
- Q7. What does t.join() do for a thread t?
- Q8. What does this print? (code)
- Q9. Why must ProcessPoolExecutor code be inside if name == "main": on Windows?
- Q10. Which statement about threads and processes is correct?