Theory:
Single CPU can execute one process at a time. Also thread is light weight process. It means CPU can execute one thread at a time.
As mentioned here
CPython implementation detail: In CPython, due to the Global Interpreter Lock, only one thread can execute Python code at once (even though certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational resources of multi-core machines, you are advised to use multiprocessing. However, threading is still an appropriate model if you want to run multiple I/O-bound tasks simultaneously.
Questions:
- Why do we blame global interpreter lock of python, if one thread can execute one time at CPU level itself ?
- Python thread is Kernel or User level thread ?
- I/O bound tasks still involve CPU, right ? How I/O affects to threading, does it really affect ?
My understanding to (1st question):
Single CPU: Global interpreter lock doesn't matter.
Multi Core CPU: In multi core CPU, we won't be able to take advantages of thread because of global interpreter lock.
Does it mean we can achieve parallel processing in Multi Core CPU ?
Is my above understanding to 1st question correct ? Also what will be the answers to other questions ?
P.S: After reading above question you must have got that my understanding with respect to (multi)threading/(multi)processing/multitasking/ of OS vs Python is not connected properly. I just asked this question so that I can connect the dots. It will be really appreciated if you can provide any link/blog/book which can make understanding correct.