Last modified 23 months ago Last modified on 06/05/2012 10:07:59 PM

Summer Of Code 2010


Stackless Python is offering projects for the Google Summer of Code in 2010 under the Python Software Foundation umbrella.


Asynchronous IO support

Language: C

Language: Python

Difficulty: Medium.

Primary mentor: Denis Bilenko.

Secondary mentor: Richard Tew.

Stackless Python divides the time allocated to its thread, between the microthreads the user has created and scheduled. However, most of the Python standard library functionality is based on blocking, or synchronous IO. This means that when any of those microthreads uses standard library functionality that does IO, it is more than likely going to block any other microthread from running until that IO peration completes.

The obvious solution at the hands of a developer is to use non-blocking, or asynchronous IO. However, in doing so they either need to hack custom versions of the appropriate standard library functionality they want to use to work on top of that non-blocking IO, or they need to write their own implementation. This places a large burden on any developer who might want to use Stackless Python, and makes any development they may engage in difficult.

This project is intended to provide a library which when used by a developer, will "monkey patch" all the synchronous/blocking IO in the standard library to work in a manner that does not block. By using this library, a developer then proceed to gain the benefits of using Stackless Python while making full use of the functionality provided by the standard library.

Denis Bilenko has implemented gevent, a library that accomplishes his for Greenlets, a small subset of the Stackless Python functionality which at some point was extracted and packaged.

The goal of this project is to port that library to Stackless Python, and then to extend it to work in a generic fashion which supports other networking resources than libevent.

Debugging support

Language: C (Stackless debugging support examination / possibly also modification)

Language: Python (unit tests, debugger support).

Difficulty: Medium.

Primary mentor: Richard Tew.

Debugging in Stackless Python has a different paradigm, with code running within the microthreads (tasklets) which it provides. While the set of changes that have been made to regular Python to make it into Stackless Python is very small, they include customisations to the debugging support to allow nstallation of hooks on a per-tasklet basis, rather than a per-thread basis. Unfortunately, this change is incompatible with the standard library debugging support.

A student who took up this task would be required to ascertain whether these debugging support changes were really needed. If they were not needed, they would be required to create patches that remove them.

Regardless of the change in debugging API, the student would be required to extend existing debuggers in a backwards compatible way to work with Stackless. This would include the debuggers in the standard library, and the most commonly used external debuggers. For example, WinPDB is a debugger with a intuitive user interface, and the most obvious extension would be to add user interface support for showing Stackless Python-specific state. What tasklets are running. Allow breakpointing tasklets without blocking the entire scheduler and thread when the breakpoint is hit.