🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Threads, Processes and the GIL: all 10 questions

Quiz: Threads, Processes and the GIL · Question 1 of 10

What does the GIL do in CPython?

What does the GIL do in CPython?

  1. A.It stops a program from starting more than one thread
  2. B.It allows only one thread to run Python code at a time in a process
  3. C.It locks files so that two programs cannot open them
  4. D.It makes every variable thread-safe
Answer & explanation

Correct answer: It allows only one thread to run Python code at a time in a process

Threads still exist and switch, but only one runs Python bytecode at any instant.

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 →