Arama Sonuçları: "#PythonGIL"

16 sonuç
Pratik Sontakke
Pratik Sontakke@PratikSontakke_·
📊 RESULTS BREAKDOWN: • Sync: 38.00s (baseline) • AsyncIO: 27.21s (-28%) • Threading: 26.14s (-31%) • ThreadPool: 25.73s (-32%) • Multiprocessing: 7.72s (-80%) • ProcessPool: 7.17s (-81%) 🏆 🔑 GIL = bottleneck for CPU work! #PythonGIL #Benchmarks #Concurrency
English
0
0
1
52
Tushar
Tushar@TusharKasaudha6·
But here's the catch: Python has a Global Interpreter Lock (GIL). Think of it as a single "talking stick" that only one chef can hold at a time. Even if you have multiple chefs (threads), only one can actively execute Python bytecode at any given moment. 🎤 #PythonGIL #GIL
English
1
0
0
11
Lal Zada
Lal Zada@BuildWithLal·
𝗣𝘆𝘁𝗵𝗼𝗻 𝟯.𝟭𝟯 has introduced experimental support for running in a 𝗳𝗿𝗲𝗲-𝘁𝗵𝗿𝗲𝗮𝗱𝗲𝗱 𝗺𝗼𝗱𝗲, which disables the Global Interpreter Lock (GIL). This allows Python to fully utilize multi-core processors by running threads in parallel. #Python #PythonGIL
English
0
0
0
18
PyCon Estonia
PyCon Estonia@PyConEstonia·
We're excited to announce our next speaker, Jacek Kołodziej! Join us as he dives into the intriguing world of Python's GIL 🐍💡. Curious about its impact? Wondering if you should care? Don't miss this insightful talk! 🗣️🇪🇪 #PyConEstonia2023 #PythonGIL @Unit03
English
0
0
2
583
Xu Lin
Xu Lin@undefined_it·
🧵 In summary, the Python GIL is like a cautious guardian, that allows only one thread to execute Python code at a time to avoid conflicts in certain situations.Though it can impact performance for specific tasks, understanding when and how to work around is the key #PythonGIL
English
0
0
0
37
Xu Lin
Xu Lin@undefined_it·
🧵 Also remember, the GIL is unique to Python 🐍 Other programming languages like Java ,C#, C++ manage multi-threading differently, and they do not have a GIL-like restriction. So, the choice of language also depends on your project's specific needs. #PythonGIL
English
1
0
0
40
Xu Lin
Xu Lin@undefined_it·
🧵 Bear in mind, threading still has its benefits! 😄For tasks that involve a lot of I/O, For eg: reading and writing files or making network requests, threads can help you manage multiple tasks concurrently without waiting too much. #PythonGIL
English
1
0
0
12
Xu Lin
Xu Lin@undefined_it·
🧵 When does the GIL matter most? 🕒 For heavy number-crunching or compute intensive tasks using libraries like NumPy, the GIL might slow things down. But for most everyday tasks, like web development, the GIL's impact is generally not a concern #PythonGIL
English
1
0
0
7
Xu Lin
Xu Lin@undefined_it·
🧵 Is there a way around the GIL? 🤔 Yes! Instead of threads, you can use processes. Processes have their own memory space and don't share the GIL, so they can run in parallel. The "multiprocessing" module in Python helps with this approach. #PythonGIL
English
1
0
0
6
Xu Lin
Xu Lin@undefined_it·
🧵 How about multi-core CPUs? 🖥️ Even if your computer has multiple cores, the GIL still restricts Python code execution to one thread at a time. So, it might not fully utilize all those cores for certain tasks. #PythonGIL
English
1
0
0
10
Xu Lin
Xu Lin@undefined_it·
🧵 hmm , doesn't that mean multi-threading is useless in Python? 🤷‍♀️ Not quite! The GIL mainly affects CPU-bound tasks, where a lot of processing happens. If your program does a lot of waiting, like network requests or I/O operations, threads can still be helpful. #PythonGIL
English
1
0
0
7
Xu Lin
Xu Lin@undefined_it·
🧵 Reason for GIL? 🤔 In Python, some data structures aren't designed to be thread-safe i.e things may not work as expected if multiple threads try to modify them at the same time. The GIL prevents this by allowing only one thread to execute Python code at a time. #PythonGIL
English
1
0
0
9
Xu Lin
Xu Lin@undefined_it·
🧵 Imagine your computer's CPU as a highway, and each thread is a car 🚗 The GIL is like a rule that says only one car can be on the highway at a time, even if there are multiple lanes. This keeps things safe but can slow down traffic. #PythonGIL
English
1
0
0
8
Xu Lin
Xu Lin@undefined_it·
What's the Python GIL? 🧵 Let's try to explain in simple terms! The GIL, or Global Interpreter Lock, is like a traffic cop inside your computer 🚦 It helps manage the flow of code when multiple threads want to run in a Python program. #PythonGIL
English
1
0
0
53