Your Python Code Is UNSAFE (seriously) – GIL’s Hidden Secret
In this video, we take a deep dive into the inner mechanics of Python’s Global Interpreter Lock (GIL), which is a must for all threading and multiprocessing devs, and expose a subtle nonce / hidden vulnerability, which could potentially make your code unsafe. Join us as we explore the impact of GIL on threading and multiprocessing, and discover how it affects the performance and scalability of your Python programs. By the end of this video, you’ll gain valuable insights and learn proper threading practices that can help you avoid potential pitfalls.
0:00 – Overview
1:15 – Python threading example
3:50 – Threading
5:46 – GIL (Global Interpreter Lock)
6:24 – CPU bound vs IO bound
7:40 – Purpose of GIL
8:21 – Multiprocessing
9:25 – GILs downfall
Source code – https://github.com/daniel-boctor/Daniel-Boctor-Youtube/tree/main/GIL
WE HAVE A DISCORD NOW! https://discord.gg/WYqqp7DXbm
MUSIC CREDITS:
LEMMiNO – Cipher
https://youtu.be/b0q5PR1xpA0?si=pUNJUB-ra1ulTJtI
CC BY-SA 4.0
LEMMiNO – Nocturnal
https://youtu.be/epmoV2HRs9U?si=Rljr2wC0SKYFEruJ
CC BY-SA 4.0
GIVEAWAY:
A random comment from this video will be selected 7 days after publication to receive the assorted pack of programming stickers shown in the video! All expenses covered. Let me know what you think!