How to Achieve TRUE Parallelism in Python with Multiprocessing [tutorial]

Опубликовано: 08 Август 2023
на канале: Haseeb Kamal
836
29

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, we explore the multiprocessing module in Python and go over the main features.

We look at how multiprocessing can speed up a CPU bound application, we also look at how to achieve interprocess communication through Queues and how to use shared variables using Values. Finally, we uncover the importance of locks in concurrent and parallel tasks touching upon race conditions and how locks help prevent them. All this is shown using practical, real life examples!

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

00:00 intro
00:36 speed up with multiprocessing
02:28 using cpu count for num processes
03:00 Interprocess communication with Queue
04:10 Pools to streamline process creation
06:12 Race conditions and Locks
07:13 Sharing objects through Value and Array
08:23 Race conditions uncovered (no locks)!
09:17 Solving it through locks!
10:15 Code messed up if not using Value!
11:07 Let me know if you want more videos on this :)

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

Subscribe here:    / @haseebkamal  


На этой странице сайта вы можете посмотреть видео онлайн How to Achieve TRUE Parallelism in Python with Multiprocessing [tutorial] длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Haseeb Kamal 08 Август 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 836 раз и оно понравилось 29 зрителям. Приятного просмотра!