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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is multithreading?

A
  • An operating system mechanism for parallel operations
  • Threads run on the same CPU but utilize multiple cores
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly