FAQ
Hi,


Just thought some people may be interested to hear that I've recently been
looking at adding true concurrency into Kamaelia, by using Paul Boddie's
pprocess as the core mechanism to allow us to run multiple Kamaelia systems
in the same app. (Since we have thread based, and co-operative generator
based components, process based is the next logical step)

[1] http://kamaelia.sourceforge.net/Home
[2] http://pypi.python.org/pypi/pprocess

Anyhow, first proof of concept is to take a _relatively_ non-trivial app and
a library hostile to being run in a single process and run it across
multiple processes trivially. (I can't test multicpu since I don't have a
multicpu machine, but this should work fine with a modern OS)

So the app I've chosen is a simple pygame based drawing/doodling app, and to
get it to launch 8 pygame windows from 1 app. Since neither SDL nor pygame
directly support this it struck me as not just a visible proof of concept,
but a useful one too (since pygame rocks! :-)

Anyhow, I've written up the code here and posted a screenshot here:
http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&nodeid96129474

You'll note 8 pygame windows ... :-)

The original base test is here:
http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&nodeid96029230

For those curious who don't like clicking on links, the code needed to allow
the 8 pygame windows looks like this:

class SecondProcessBasedComponent(SimplestProcessComponent):
def main(self):
from Kamaelia.UI.Pygame.Display import PygameDisplay
from Kamaelia.UI.Pygame.MagnaDoodle import MagnaDoodle

X=PygameDisplay(width 0,height 0).activate()
PygameDisplay.setDisplayService(X)
MagnaDoodle().run()
yield 1

exchange = SecondProcessBasedComponent().activate()
R = []
for _ in xrange(7):
R.append(SecondProcessBasedComponent().activate())

So far, so good :-)

Incidentally, yes the project is alive and well, but a resource crunch
at work means I'm working on this only on my own time at the mo, which
means things like releases are having a longer cycle between them than
I'd like. Some recent developments include a greylisting proxy server,
a ER modelling tool and a (very) simple pygame based logo like tool for
teaching programming to small children. The webserver is aiming for WSGI
compliance, and the project also had a small number of students working
over the summer, assisting with some useful things like AIM/IRC integration,
the ability to use Kamaelia systems in non-Kamaelia based scripts/systems,
and looking at a sub-component model. (ie non-concurrent systems)


Michael.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 2, '07 at 1:14a
activeDec 2, '07 at 1:14a
posts1
users1
websitepython.org

1 user in discussion

Michael Sparks: 1 post

People

Translate

site design / logo © 2022 Grokbase