Stackless Python
Page Module:Message box/ambox.css has no content.Page Template:Multiple issues/styles.css has no content.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
Page Module:Message box/ambox.css has no content.
|
Page Module:Infobox/styles.css has no content.
| Stackless Python | |
|---|---|
| [[Programmer|Original authorTemplate:Pluralize from text]] | Christian Tismer |
| [[Programmer|DeveloperTemplate:Pluralize from text]] | Anselm Kruis |
| Initial release | 1998 |
| Written in | C, Python |
| Engine | Page Template:Plainlist/styles.css has no content.Template:EditAtWikidata |
| Operating system | Linux, macOS, Windows |
| Type | Interpreter |
| License | Python Software Foundation License |
| Website | github.com/stackless-dev |
| Repository | Page Template:Plainlist/styles.css has no content.
|
Script error: No such module "Check for conflicting parameters".
Stackless Python, or Stackless, was a Python programming language interpreter. Its GitHub repository has been archived since February 2025, and the project has been officially discontinued.
It was so named because it avoids depending on the C call stack for its own stack. In practice, Stackless Python uses the C stack, but the stack is cleared between function calls.[1] The most prominent feature of Stackless is microthreads, which avoid much of the overhead associated with usual operating system threads. In addition to Python features, Stackless also adds support for coroutines, communication channels, and task serialization.
Design
With Stackless Python, a running program is split into microthreads that are managed by the language interpreter itself, not the operating system kernel—context switching and task scheduling is done purely in the interpreter (these are thus also regarded as a form of green thread). Microthreads manage the execution of different subtasks in a program on the same CPU core. Thus, they are an alternative to event-based asynchronous programming and also avoid the overhead of using separate threads for single-core programs (because no mode switching between user mode and kernel mode needs to be done, so CPU usage can be reduced).
Although microthreads make it easier to deal with running subtasks on a single core, Stackless Python does not remove CPython's global interpreter lock (GIL), nor does it use multiple threads and/or processes. So it allows only cooperative multitasking on a shared CPU and not parallelism (preemption was originally not available but is now in some form[2]). To use multiple CPU cores, one would still need to build an interprocess communication system on top of Stackless Python processes.
Due to the considerable number of changes in the source, Stackless Python cannot be installed on a preexisting Python installation as an extension or library. It is instead a complete Python distribution in itself. The majority of Stackless's features have also been implemented in PyPy, a self-hosting Python interpreter and JIT compiler.[3]
Use
Although the whole Stackless is a separate distribution, its switching functionality has been successfully packaged as a CPython extension called greenlet.[4] It is used by a number of libraries (e.g. gevent[5]) to provide a green threading solution for CPython. Python since has received an alternative native solution for asynchronous programming running on a single thread: await/async.
Stackless is used extensively in the implementation of the Eve Online massively multiplayer online game as well as in IronPort's mail platform.
See also
Lua error in mw.title.lua at line 404: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').
- Erlang (programming language)
- Limbo (programming language)
- Go (programming language)
- SCOOP (software)
References
Page Template:Reflist/styles.css has no content.
- ^ Archived at Ghostarchive and the Wayback Machine: Page Module:Citation/CS1/styles.css has no content.The story of stackless Python. YouTube.
- ^ Page Module:Citation/CS1/styles.css has no content."About Stackless". Archived from the original on 23 June 2020. Retrieved 26 August 2016.
a round robin scheduler is built in. It can be used to schedule tasklets either cooperatively or preemptively.
- ^ Page Module:Citation/CS1/styles.css has no content."Application-level Stackless features — PyPy documentation". pypy.readthedocs.org.
- ^ Page Module:Citation/CS1/styles.css has no content."greenlet: Lightweight concurrent programming — greenlet 0.4.0 documentation". greenlet.readthedocs.org.
- ^ Page Module:Citation/CS1/styles.css has no content."What is gevent? — gevent 1.3.0.dev0 documentation". www.gevent.org.
External links
- Lua error in Module:Official_website at line 94: attempt to index field 'wikibase' (a nil value).
- Stackless Python Documentation for: 3.7-slp, 3.6-slp, 3.5-slp, 3.4-slp, 2.7-slp
- stackless on GitHub
- Multithreaded Game Scripting with Stackless Python by Harry Kalogirou
- Continuations and Stackless Python by Christian Tismer
Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.