|
|
|
|
|
by sgtlaggy
1441 days ago
|
|
Concurrency in Python is a weird topic, since multiprocessing is the only "real" concurrency. Threading is "implicit" context switching all in the same process/thread, asyncio is "explicit" context switching.
On top of that, you also have the complication of the GIL. If threads don't release the GIL, then you can't effectively switch contexts. |
|
You are confusing concurrency and parallelism.
> Threading is "implicit" context switching all in the same process/thread
No, threading is separate native threads but with a lock that prevents execution of Python code in separate threads simultaneously (native code in separate threads, with at most on running Python, can still work.)