Adam Olsen wrote:
> That would depend on whether Joachim's wait() refers to the individual
> tasks' calls or the scheduler's call.  I assumed it referred to the
> scheduler.  In the basic form it would literally be select.select(),
> which has O(n) cost and often fairly large n.
The wait(events, timeout) call of a task would only mention the events
that the task is interested in. The wait() call yields that list to the 
scheduler.

The scheduler then analyzes the list of events that tasks are waiting for
and compares it to it's last call to select/poll/kevent and continues
tasks in a round robin fashion until all events have been scheduled to
the waiting tasks. Only when the scheduler has no events to deliver
(e.g. all tasks are waiting) a new select/poll/kevent OS call is made
by the scheduler, with a computed timeout to the lowest timeout value
of all the tasks, so that a timeout can be delivered at the right time.

Joachim
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to