GIL (Global Interpreter Lock) minangka mutex ing CPython (implementasi Python standar) sing ngidini mung siji thread kanggo execute Python bytecode ing wektu sing sama. Iki tegese thread Python ora bisa run Python code ing paralel sejati ing macem-macem CPU cores — pertimbangan utama kanggo concurrency.
Apa tegese GIL ing praktik
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.
Beda krusial: CPU-bound vs I/O-bound
threading
():
(i * i i ())
():
response = requests.get(url)
