Lecture 3 - Parallel Programming with Python Flashcards
1
Q
Why does python have problem with multiprocessing?
A
Python uses GIL (Global Interpreter Lock) that ensures only one thread executed at a time
2
Q
What is multithreading?
A
- An operating system mechanism for parallel operations
- Threads run on the same CPU but utilize multiple cores
3
Q
What is multiprocessing?
A
Several independent processes (programs) are started by the main application process
- Subprocesses cannot share memory and usually don’t communicate with each other
- Can run on different CPUs
4
Q
Why is multiprocessing enough for data science?
A
- Many tasks are parallel
- There is too much data to process sequantially
- Dividing the data into subsets can reduce the time needed
- No communication needed between cluster nodes