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
a31b9ccb
Kaydet (Commit)
a31b9ccb
authored
Nis 21, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Delay zero after successful action.
üst
fa0e7261
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
sched.py
Lib/sched.py
+8
-2
No files found.
Lib/sched.py
Dosyayı görüntüle @
a31b9ccb
...
...
@@ -11,8 +11,8 @@
# and millisleep from the built-in module time, or you can implement
# simulated time by writing your own functions. This can also be
# used to integrate scheduling with STDWIN events; the delay function
# is allowed to modify the queue. Time can be expressed
#
as
integers or floating point numbers, as long as it is consistent.
# is allowed to modify the queue. Time can be expressed
as
# integers or floating point numbers, as long as it is consistent.
# Events are specified by tuples (time, priority, action, argument).
# As in UNIX, lower priority numbers mean higher priority; in this
...
...
@@ -83,6 +83,11 @@ class scheduler():
# exceptions are not caught but the scheduler's state
# remains well-defined so run() may be called again.
#
# A questionably hack is added to allow other threads to run:
# just after an event is executed, a delay of 0 is executed,
# to avoid monopolizing the CPU when other threads are also
# runnable.
#
def
run
(
self
):
q
=
self
.
queue
while
q
:
...
...
@@ -93,4 +98,5 @@ class scheduler():
else
:
del
q
[
0
]
void
=
action
(
argument
)
self
.
delayfunc
(
0
)
# Let other threads run
#
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