File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,13 @@ Context
1111The GIL
1212-------
1313
14+ `The GIL `_ (Global Interpreter Lock) is how Python allows multiple threads to operate at the same time. Python's
15+ memory management isn't entirely thread-safe, so the GIL is requried to prevents multiple threads from running
16+ the same Python code at once.
1417
18+ David Beazley has a great `guide `_ on how the GIL operates. He also covers the `new GIL `_ in Python 3.2. His
19+ results show that maximizing performance in a Python application requires a strong understanding of the GIL,
20+ how it affects your specific application, how many cores you have, and where your application bottlenecks are.
1521
1622C Extentions
1723------------
@@ -20,8 +26,8 @@ C Extentions
2026The GIL
2127-------
2228
23-
24-
29+ ` Special care `_ must be taken when writing C extensions to make sure you register your threads
30+ with the interpreter.
2531
2632C Extentions
2733::::::::::::
@@ -56,4 +62,8 @@ Multiprocessing
5662---------------
5763
5864
59- .. _`PyPy` : http://pypy.org
65+ .. _`PyPy` : http://pypy.org
66+ .. _`The GIL` : http://wiki.python.org/moin/GlobalInterpreterLock
67+ .. _`Understanding GIL` : http://www.dabeaz.com/python/UnderstandingGIL.pdf
68+ .. _`New GIL` : http://www.dabeaz.com/python/NewGIL.pdf
69+ .. _`Thread State` : http://docs.python.org/c-api/init.html#threads
You can’t perform that action at this time.
0 commit comments