How to Speed Up Python Code with Threading [Tutorial]

Publicado el: 01 agosto 2023
en el canal de: Haseeb Kamal
1,534
50

Multithreading and multiprocessing allow computers to multitask and perform various tasks at the same time.
These concepts also help provide insane speedups to Python code.

In this video I will present the threading module in Python.
But first, I briefly explain threads, processes and the differences between parallelism and concurrency. Due to the global interpreter lock Python multithreading only achieves concurrency and not parallelism.

We look at some examples of how to speed up a Python program by using multiple threads. Finally, I also demonstrate through a code example how multithreading only leads to speed up in IO bound applications (and not CPU bound ones).

Source code:
https://github.com/mhkamal1/yt-conten...

00:00 intro
00:29 what are threads and processes?
01:12 client and server example
01:36 Global interpreter lock
01:55 parallelism vs. concurrency
03:53 Code: simple multithreading
05:30 Code: speed up with multithreading
07:16 Code: multithreading fails at CPU bound tasks
08:19 End

Please consider liking if you found the video useful and subscribe for more!

Subscribe here:    / @haseebkamal  


En esta página del sitio puede ver el video en línea How to Speed Up Python Code with Threading [Tutorial] de Duración hora minuto segunda en buena calidad , que subió el usuario Haseeb Kamal 01 agosto 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,534 veces y le gustó 50 a los espectadores. Disfruta viendo!