filmov
tv
Python Multithreading & Multiprocessing and Why You Should Avoid Them

Показать описание
Why You Should Avoid Multithreading & Multiprocessing in Python?
0. Global Interpreter Lock
2. Most things you can think of as multithreaded applications and such might actually be already multithreaded because it is calling some C code.
3. There are realities that are hidden in the implementations that no one teaches you, e.g. pickling to share data etc. And this has 2 major problems: (1) the larger community is unaware of these issues and (2) this becomes a bad cycle as people start to teach these concepts without going in any depths. As learners, too many times we are told that just use the package and it is fast without knowing what is happening.
4. It is extremely hard to debug because of 2.
5. Why not use another language, like Rust, to write your computation intensive part of code?
Obviously, there are still times when multithreading can be helpful, like downloading a lot of stuff. Multiprocessing is, well, a little too much overhead in most cases. When using OOP in Python, you have to be very careful when you want to use multiprocessing in your class methods. It might copy too much data, or your class object just cannot be pickled.
Slip of mouth at 29:00. I mean multithreading...
0. Global Interpreter Lock
2. Most things you can think of as multithreaded applications and such might actually be already multithreaded because it is calling some C code.
3. There are realities that are hidden in the implementations that no one teaches you, e.g. pickling to share data etc. And this has 2 major problems: (1) the larger community is unaware of these issues and (2) this becomes a bad cycle as people start to teach these concepts without going in any depths. As learners, too many times we are told that just use the package and it is fast without knowing what is happening.
4. It is extremely hard to debug because of 2.
5. Why not use another language, like Rust, to write your computation intensive part of code?
Obviously, there are still times when multithreading can be helpful, like downloading a lot of stuff. Multiprocessing is, well, a little too much overhead in most cases. When using OOP in Python, you have to be very careful when you want to use multiprocessing in your class methods. It might copy too much data, or your class object just cannot be pickled.
Slip of mouth at 29:00. I mean multithreading...
threading vs multiprocessing in python
Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)
Difference between Multiprocessing and Multithreading
Threading vs Multiprocessing in Python
Multiprocessing in Python
The Python Global Interpreter Lock - Explained
Python Threading Explained in 8 Minutes
Многопоточность и Асинхронность в Программировании | Python Threading и Multiprocessing...
Threading vs. multiprocessing in Python
Python Tutorial - Multiprocessing vs Multithreading
Threading vs Multiprocessing in Python - Advanced Python 15 - Programming Tutorial
#64 Python Tutorial for Beginners | MultiThreading
Hitul Mistry - Python Multithreading and Multiprocessing: Concurrency and Parallelism
Python Asynchronous Programming - 3 vs MultiThreading vs MultiProcessing
Python Multiprocessing Tutorial: Run Code in Parallel Using the Multiprocessing Module
How to make multiple API calls at the same time | Python Multithreading
Unlocking your CPU cores in Python (multiprocessing)
Multithreading in Python | Python Tutorial - Day #97
FANG Interview Question | Process vs Thread
Python Threading Tutorial: Run Code Concurrently Using the Threading Module
Multithreading Is NOT What You Think
How to Deal With Concurrency in Python
Multiprocessing versus Threading in Python #shorts
MultiProcessing in Python | Python Tutorial - Day #98
Комментарии