Help me use my Dual Core CPU!

Michael ms at cerenity.org
Tue Sep 12 16:53:34 EDT 2006


Simon Wittber wrote:

> I've just bought a new notebook, which has a dual core CPU.
> 
> I write cross platform games in Python, and I'd really like to be able
> to use this second core (on my machine, and on user's machines) for any
> new games I might write.
> 
> I know threads won't help (in CPython at least) so I'm investigating
> other types of concurrency which I might be able to use. I really like
> the PyLinda approach, however I need to be able to pass around all the
> simple python types, which PyLinda won't help me with. Also, PyLinda is
> more focused on distributing computing; I really only want to have 2
> processes cooperating (or 4, if I had 4 CPUs/cores etc).
> 
> Is there any cross platform way to share python objects across
> processes? (I've found POSH, but it's old, and doesn't appear to be
> maintained). I could implement my own object space using shared memory,
> but from what I can see, this is not available on Win32.
> 
> Are there any other concurrency options I've not discovered yet?

We *haven't* implemented process based components for Kamaelia yet, however
if a process component base class (which is something we want to do) was
created that might serve as a possiblity. If you're interested in this I
could chat with you about the ideas we've had about how this would work
(#kamaelia on freenode or here). (We are planning on doing this when we
manage to get sufficient round tuits).

It's probably worth noting that we wouldn't be thinking of using shared
objects, but piping data between the two processes - with the various
options including pickling to memory mapped files (however there's security
issues there aside from anything else...).

Also, Paul Boddie posted a module for parallel systems a while back as well
which might be useful (at least for ideas):
   * http://cheeseshop.python.org/pypi/parallel

I'd be interested in helping out BTW :)


Michael.
--
http://kamaelia.sourceforge.net/Home
http://yeoldeclue.com/blog




More information about the Python-list mailing list