On 9/30/05, Antoine Pitrou <[EMAIL PROTECTED]> wrote:
>
> > (C)  That scheduler is non-preemptive.  A single
> > greedy generator can starve all the others.
>
> Instead of looking at this as a problem, you could look at it as a
> feature. Since generators can't be switched at arbitrary places, the
> programmer has to define his/her synchronization points explicitly.

I use this approach extensively, using tasks which are defined using
generators. The scheduler I developed for this can be viewed here:

http://metaplay.dyndns.org:82/svn/nanothreads/nanothreads.py

Synchronization using yield statements is an important feature, as I
use these cooperative threads for game development. These threads are
_very_ useful for games, as they have very low overhead, and allow the
programmer to exercise more control over their execution.

Sw.
_______________________________________________
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