Skip to main content

Greenlets are lightweight coroutines for in-process concurrent programming

Project description

This project is a branch of greenlet on QPython.

Greenlets are lightweight coroutines for in-process concurrent programming.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

greenlet_qpython-3.1.1.4.tar.gz (308.8 kB view details)

Uploaded Source

Built Distribution

greenlet_qpython-3.1.1.4-py3-none-any.whl (337.9 kB view details)

Uploaded Python 3

File details

Details for the file greenlet_qpython-3.1.1.4.tar.gz.

File metadata

  • Download URL: greenlet_qpython-3.1.1.4.tar.gz
  • Upload date:
  • Size: 308.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for greenlet_qpython-3.1.1.4.tar.gz
Algorithm Hash digest
SHA256 a28934afeec0f3fe95b61b6c224290673c133574a386ac9f279f9cc52e7e670b
MD5 112443718e88c210809502ee93abf6d6
BLAKE2b-256 3062bf76ad9257a13b398663112c9e15960c5e7b74200cf374238692b9c4c3b4

See more details on using hashes here.

File details

Details for the file greenlet_qpython-3.1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for greenlet_qpython-3.1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 02a604e824a5af20263b8be670f2e0c03af8a40e288e0257011461d52da1ec25
MD5 ad6d9855cbc72f9574fe18838c60383d
BLAKE2b-256 3f62ab39db8049071a67c4c0ffb034f22befa79f3408c09a3d03e534f9bb773b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page