← Quiz: Threads, Processes and the GIL: all 10 questions
Quiz: Threads, Processes and the GIL · Question 2 of 10
A program downloads 100 web pages. Which tool gives the easiest big speed-up?
A program downloads 100 web pages. Which tool gives the easiest big speed-up?
- A.ThreadPoolExecutor, because the threads spend most of their time waiting
- B.Nothing helps because of the GIL
- C.ProcessPoolExecutor, because only processes can run at the same time
- D.A single for loop is already the fastest
Answer & explanation
Correct answer: ThreadPoolExecutor, because the threads spend most of their time waiting
Downloading is I/O-bound; a waiting thread releases the GIL so others can work.
Can you get the rest right without peeking?
Take the timed Quiz: Threads, Processes and the GIL quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →