Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
00342815
Kaydet (Commit)
00342815
authored
Ock 06, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Elaborate about the GIL.
üst
f8dc9ca8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
glossary.rst
Doc/glossary.rst
+23
-13
threading.rst
Doc/library/threading.rst
+12
-0
No files found.
Doc/glossary.rst
Dosyayı görüntüle @
00342815
...
...
@@ -102,9 +102,10 @@ Glossary
See :pep:`343`.
CPython
The canonical implementation of the Python programming language. The
term "CPython" is used in contexts when necessary to distinguish this
implementation from others such as Jython or IronPython.
The canonical implementation of the Python programming language, as
distributed on `python.org <http://python.org>`_. The term "CPython"
is used when necessary to distinguish this implementation from others
such as Jython or IronPython.
decorator
A function returning another function, usually applied as a function
...
...
@@ -263,16 +264,25 @@ Glossary
See :term:`global interpreter lock`.
global interpreter lock
The lock used by Python threads to assure that only one thread
executes in the :term:`CPython` :term:`virtual machine` at a time.
This simplifies the CPython implementation by assuring that no two
processes can access the same memory at the same time. Locking the
entire interpreter makes it easier for the interpreter to be
multi-threaded, at the expense of much of the parallelism afforded by
multi-processor machines. Efforts have been made in the past to
create a "free-threaded" interpreter (one which locks shared data at a
much finer granularity), but so far none have been successful because
performance suffered in the common single-processor case.
The mechanism used by the :term:`CPython` interpreter to assure that
only one thread executes Python :term:`bytecode` at a time.
This simplifies the CPython implementation by making the object model
(including critical built-in types such as :class:`dict`) implicitly
safe against concurrent access. Locking the entire interpreter
makes it easier for the interpreter to be multi-threaded, at the
expense of much of the parallelism afforded by multi-processor
machines.
However, some extension modules, either standard or third-party,
are designed so as to release the GIL when doing computationally-intensive
tasks such as compression or hashing. Also, the GIL is always released
when doing I/O.
Past efforts to create a "free-threaded" interpreter (one which locks
shared data at a much finer granularity) have not been successful
because performance suffered in the common single-processor case. It
is believed that overcoming this performance issue would make the
implementation much more complicated and therefore costlier to maintain.
hashable
An object is *hashable* if it has a hash value which never changes during
...
...
Doc/library/threading.rst
Dosyayı görüntüle @
00342815
...
...
@@ -17,11 +17,23 @@ The :mod:`dummy_threading` module is provided for situations where
methods and functions in this module in the Python 2.x series are still
supported by this module.
.. impl-detail::
Due to the :term:`Global Interpreter Lock`, in CPython only one thread
can execute Python code at once (even though certain performance-oriented
libraries might overcome this limitation).
If you want your application to make better of use of the computational
resources of multi-core machines, you are advised to use
:mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`.
However, threading is still an appropriate model if you want to run
multiple I/O-bound tasks simultaneously.
.. seealso::
Latest version of the :source:`threading module Python source code
<Lib/threading.py>`
This module defines the following functions and objects:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment