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
3bc5cb7e
Kaydet (Commit)
3bc5cb7e
authored
Mar 04, 2010
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7805: wait until all workers are started before collecting their PIDs
üst
a36e245d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
process.py
Lib/multiprocessing/process.py
+1
-1
test_multiprocessing.py
Lib/test/test_multiprocessing.py
+9
-1
No files found.
Lib/multiprocessing/process.py
Dosyayı görüntüle @
3bc5cb7e
...
...
@@ -179,7 +179,7 @@ class Process(object):
@property
def
ident
(
self
):
'''
Return i
n
dentifier (PID) of process or `None` if it has yet to start
Return identifier (PID) of process or `None` if it has yet to start
'''
if
self
is
_current_process
:
return
os
.
getpid
()
...
...
Lib/test/test_multiprocessing.py
Dosyayı görüntüle @
3bc5cb7e
...
...
@@ -1070,8 +1070,16 @@ class _TestPoolWorkerLifetime(BaseTestCase):
self
.
assertEqual
(
res
.
get
(),
sqr
(
j
))
# Refill the pool
p
.
_repopulate_pool
()
# Finally, check that the worker pids have changed
# Wait until all workers are alive
countdown
=
5
while
countdown
and
not
all
(
w
.
is_alive
()
for
w
in
p
.
_pool
):
countdown
-=
1
time
.
sleep
(
DELTA
)
finalworkerpids
=
[
w
.
pid
for
w
in
p
.
_pool
]
# All pids should be assigned. See issue #7805.
self
.
assertNotIn
(
None
,
origworkerpids
)
self
.
assertNotIn
(
None
,
finalworkerpids
)
# Finally, check that the worker pids have changed
self
.
assertNotEqual
(
sorted
(
origworkerpids
),
sorted
(
finalworkerpids
))
p
.
close
()
p
.
join
()
...
...
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