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
c872d39d
Kaydet (Commit)
c872d39d
authored
Eki 22, 2017
tarafından
Antoine Pitrou
Kaydeden (comit)
GitHub
Eki 22, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31653: Don't release the GIL if we can acquire a multiprocessing semaphore immediately (#4078)
üst
bcbdd2f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
2017-10-22-12-43-03.bpo-31653.ttfGvq.rst
...S.d/next/Library/2017-10-22-12-43-03.bpo-31653.ttfGvq.rst
+2
-0
semaphore.c
Modules/_multiprocessing/semaphore.c
+20
-10
No files found.
Misc/NEWS.d/next/Library/2017-10-22-12-43-03.bpo-31653.ttfGvq.rst
0 → 100644
Dosyayı görüntüle @
c872d39d
Don't release the GIL if we can acquire a multiprocessing semaphore
immediately.
Modules/_multiprocessing/semaphore.c
Dosyayı görüntüle @
c872d39d
...
...
@@ -304,19 +304,29 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
deadline
.
tv_nsec
%=
1000000000
;
}
/* Check whether we can acquire without releasing the GIL and blocking */
do
{
Py_BEGIN_ALLOW_THREADS
if
(
blocking
&&
timeout_obj
==
Py_None
)
res
=
sem_wait
(
self
->
handle
);
else
if
(
!
blocking
)
res
=
sem_trywait
(
self
->
handle
);
else
res
=
sem_timedwait
(
self
->
handle
,
&
deadline
);
Py_END_ALLOW_THREADS
res
=
sem_trywait
(
self
->
handle
);
err
=
errno
;
if
(
res
==
MP_EXCEPTION_HAS_BEEN_SET
)
break
;
}
while
(
res
<
0
&&
errno
==
EINTR
&&
!
PyErr_CheckSignals
());
errno
=
err
;
if
(
res
<
0
&&
errno
==
EAGAIN
&&
blocking
)
{
/* Couldn't acquire immediately, need to block */
do
{
Py_BEGIN_ALLOW_THREADS
if
(
blocking
&&
timeout_obj
==
Py_None
)
res
=
sem_wait
(
self
->
handle
);
else
if
(
!
blocking
)
res
=
sem_trywait
(
self
->
handle
);
else
res
=
sem_timedwait
(
self
->
handle
,
&
deadline
);
Py_END_ALLOW_THREADS
err
=
errno
;
if
(
res
==
MP_EXCEPTION_HAS_BEEN_SET
)
break
;
}
while
(
res
<
0
&&
errno
==
EINTR
&&
!
PyErr_CheckSignals
());
}
if
(
res
<
0
)
{
errno
=
err
;
...
...
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