Python uses "real" threads, i.e. threads of the underlying platform. On Linux, it will use the pthread library (if you're interested, here is the implementation ).
A feature of Python threads is the GIL: a thread can only modify Python data structures if it contains this global lock. Thus, many Python operations cannot use multiple processor cores. A thread with a blocking socket will not hold the GIL, so it does not affect other threads.
GILs are often misunderstood, leading people to believe that threads are almost useless in Python. The only thing that prevents GIL is the simultaneous execution of "clean" Python code on multiple processor cores. If you use threads to respond to the GUI or to run different code while blocking I / O, GIL will not affect you. If you use threads to run code in some C extension, such as NumPy / SciPy, on multiple processor cores at the same time, GIL will not affect you either.
source share