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
ed1654fa
Kaydet (Commit)
ed1654fa
authored
Şub 10, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #20505: BaseEventLoop uses again the resolution of the clock to decide if
scheduled tasks should be executed or not.
üst
b38b5c43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
base_events.py
Lib/asyncio/base_events.py
+3
-2
test_events.py
Lib/test/test_asyncio/test_events.py
+6
-6
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
ed1654fa
...
...
@@ -96,6 +96,7 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_default_executor
=
None
self
.
_internal_fds
=
0
self
.
_running
=
False
self
.
_clock_resolution
=
time
.
get_clock_info
(
'monotonic'
)
.
resolution
def
_make_socket_transport
(
self
,
sock
,
protocol
,
waiter
=
None
,
*
,
extra
=
None
,
server
=
None
):
...
...
@@ -643,10 +644,10 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_process_events
(
event_list
)
# Handle 'later' callbacks that are ready.
now
=
self
.
time
()
end_time
=
self
.
time
()
+
self
.
_clock_resolution
while
self
.
_scheduled
:
handle
=
self
.
_scheduled
[
0
]
if
handle
.
_when
>
now
:
if
handle
.
_when
>
=
end_time
:
break
handle
=
heapq
.
heappop
(
self
.
_scheduled
)
self
.
_ready
.
append
(
handle
)
...
...
Lib/test/test_asyncio/test_events.py
Dosyayı görüntüle @
ed1654fa
...
...
@@ -1178,15 +1178,15 @@ class EventLoopTestsMixin:
yield
from
asyncio
.
sleep
(
1e-4
,
loop
=
loop
)
yield
from
asyncio
.
sleep
(
1e-6
,
loop
=
loop
)
yield
from
asyncio
.
sleep
(
1e-8
,
loop
=
loop
)
yield
from
asyncio
.
sleep
(
1e-10
,
loop
=
loop
)
self
.
loop
.
run_until_complete
(
wait
())
# The ideal number of call is 1
0
, but on some platforms, the selector
# The ideal number of call is 1
2
, but on some platforms, the selector
# may sleep at little bit less than timeout depending on the resolution
# of the clock used by the kernel. Tolerate 5 useless calls on these
# platforms.
self
.
assertLessEqual
(
self
.
loop
.
_run_once_counter
,
15
,
{
'time_info'
:
time
.
get_clock_info
(
'time'
),
'monotonic_info'
:
time
.
get_clock_info
(
'monotonic'
),
# of the clock used by the kernel. Tolerate a few useless calls on
# these platforms.
self
.
assertLessEqual
(
self
.
loop
.
_run_once_counter
,
20
,
{
'clock_resolution'
:
self
.
loop
.
_clock_resolution
,
'selector'
:
self
.
loop
.
_selector
.
__class__
.
__name__
})
...
...
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