Lightweight in-process concurrent programming
Project description
(This is the py.magic.greenlet module from the py lib <http://codespeak.net/py/>)
The “greenlet” package is a spin-off of Stackless, a version of CPython that supports micro-threads called “tasklets”. Tasklets run pseudo-concurrently (typically in a single or a few OS-level threads) and are synchronized with data exchanges on “channels”.
A “greenlet”, on the other hand, is a still more primitive notion of micro-thread with no implicit scheduling; coroutines, in other words. This is useful when you want to control exactly when your code runs. You can build custom scheduled micro-threads on top of greenlet; however, it seems that greenlets are useful on their own as a way to make advanced control flow structures. For example, we can recreate generators; the difference with Python’s own generators is that our generators can call nested functions and the nested functions can yield values too. Additionally, you don’t need a “yield” keyword. See the example in test_generator.py.
Greenlets are provided as a C extension module for the regular unmodified interpreter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for greenlet-0.1-py2.4-macosx-10.4-ppc.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f33dc4256af5bcb7edf7122e0862b25d7fa2786b6411c6900ea272c58b5eed27 |
|
MD5 | c776433fb9976e86a1d3b386609646a0 |
|
BLAKE2b-256 | 854647ed52b335d0946957eb966653207e8ea56a53d2f15c2977936f21a629cc |
Hashes for greenlet-0.1-py2.4-macosx-10.3-fat.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b8730ef03b5a71eff77e1396387af026880062457c37f40e4640fc588f6064 |
|
MD5 | 563dc89ac12e269fbe9ce08c7fb859fc |
|
BLAKE2b-256 | eaf2fc6baeec417468b905230e8b2c76fcadbb644bcb67aaf9137d559148c208 |
Hashes for greenlet-0.1-py2.3-macosx-10.4-ppc.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 713d27a22cf3338e3ed55ff10f42cf87db3fe81f5eb9dc9c5a9d15680b269875 |
|
MD5 | ef3610b55a88e31eb92954671a26ec51 |
|
BLAKE2b-256 | 6937d7c0a2fc97f345c5237953827bf06dc0e885bd606ce9ad536803962d23bb |