A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-September/056874.html below:

[Python-Dev] Pythonic concurrency - cooperative MT

[Python-Dev] Pythonic concurrency - cooperative MT [Python-Dev] Pythonic concurrency - cooperative MTAntoine Pitrou solipsis at pitrou.net
Fri Sep 30 16:55:25 CEST 2005
Le vendredi 30 septembre 2005 à 07:32 -0700, Simon Wittber a écrit :
> 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

FWIW, I've coded my own little cooperative scheduler here:
https://developer.berlios.de/projects/tasklets/

In contrast to your approach, I don't explicitly link threads. The
"yield" keyword is used to wait on a resource (for example a
synchronised queue or a timer) and the scheduling loop manages the
switching accordingly. This approach is roughly the same as in
"gtasklets" (http://www.gnome.org/~gjc/gtasklet/gtasklets.html) except
that I don't rely on the GTK event loop.

The event loop is generic and supports asynchronous resources (resources
which become ready in another system thread: for example timers are
managed in a separate helper system thread).

It's quite alpha, but there are a few examples in the examples
directory.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4