This page is about the development of DStackless, a library to add distributed features to Stackless Python. This library is part of a Master Degree research project at Université Laval, Québec, Canada and the development is still ongoing.
Networking feature to channels (a channel is both local and networked)
Tasklet migration to a remote host.
All channels connections are kept when a tasklet is moved.
Dependencies are moved automatically on demand (work in progress).
This section describes the current working API.
dstackless.identify("INTERPRETER_ID"): Uniquely identify an interpreter inside a network of interpreters.
dstackless.listen(port): Listen to a TCP port so remote interpreters can connect.
dstackless.connect(ip, port): Connect to a remote interpreter.
c = dstackless.channel("CHANNEL_IDENTIFIER"): Create a named channel. Two channels inside a network of interpreters are considered the same if they have the same name.
c.send("My message"): Send a message on a channel.
message = c.receive(): Receive a message on a channel
ref_tasklet = tasklet(nom_fonction)(un_canal): Create a tasklet that can use a channel to communicate.
ref_tasklet.move("INTERPRETER_ID"): Move a running tasklet to a remote interpreter identified by INTERPRETER_ID.
The source code of the current state of the library is available under the terms of the MIT license (http://opensource.org/licenses/mit-license.php). Consider this code ALPHA quality. I know it's a total mess but I quickly need a working prototype and then I'll consider cleaning up the code. You can download it here:
pypy-dstackless-dev-20090929.tar.bz2
This package constains two code examples using the API. Both examples have both a server application to run first and a client application that connects to the server. The first example using test-channel-*.py shows networked channels. The second example using test-pickling-*.py shows the remote migration of a running tasklet. The content of the uncompressed archive needs to be put at the root of a PyPy setup (the dstackless folder needs to be in PyPy's library folder pypy/lib). pypy-c needs to be built using "--stackless" to run the code.
If you have any comment or question, you can find my e-mail address in the header of the source files.
Gabriel Lavoie © 2009