GIL (Global Interpreter Lock) CPython (Python کی معیاری تشریح) میں ایک mutex ہے جو ایک وقت میں صرف ایک thread کو Python bytecode کو چلانے کی اجازت دیتا ہے۔ اس کا مطلب ہے کہ Python threads متعدد CPU cores پر Python code کو حقیقی طور پر متوازی نہیں چلا سکتے — یہ بیک وقتی پروسیسنگ کے لیے ایک اہم غور ہے۔
GIL کا عملی مطلب
Even with multiple threads on a multi-core CPU:
Only ONE thread runs Python bytecode at any instant.
→ Threading does NOT give CPU-bound parallelism in CPython.
