Help me use my Dual Core CPU!

Paul Rubin http
Tue Sep 12 10:17:37 EDT 2006


"Simon Wittber" <simonwittber at gmail.com> writes:
> For game programming purposes, I was hoping someone could point me to a
> technique for sharing objects across Python processes, preferably
> without any kind of marshal/unmarshal steps. It's a long shot, I know.
> To be viable, I'll need to be able to pass messages between processes
> very quickly. For example, It would be simple to paralellize some
> graphics calculations over two processors with each process sharing a
> common read-only scene data structure; however, a marshalling step in
> this kind of process would be too costly.

If it's for some specific calculation in the game, the bluntest
approach is probably to write a C extension that releases the GIL to
do the calculation, and then use ordinary threads for concurrency.
Put appropriate locks in the object to synchronize on.



More information about the Python-list mailing list