A thread is a lightweight process. Multithreading allows the programmer to execute multiple threads in one go. The Global Interpreter Lock ensures that a single thread performs at a given time. A thread holds the GIL and does some work before passing it on to the next thread. This looks like parallel execution, but actually, it is just threading taking turns at the CPU.

NOTE: The page you are accessing has some of the most basic and complex Python Interview Questions and Answers. You can download it as a PDF to read it later offline.

Suggest An Answer

No suggestions Available!