Parallelism
-
We have two categories of problems
- I/O bound
- Waiting for network to respond, db to respond
- CPU bound
- I/O bound
-
Problem or villian in this story with threads is
GIL - Concurrency (CPU Bound) => how to use cores
- How to make my program non blocking i.e. when some code is waiting for something to happen, other parts of my application work.
Threads
-
Refer Here for a basic multi threaded code.
-
In python we have GIL (Global Interpreter Lock)
- Refer Here for gil deep dive
