[mod_python] Communicating between interpreters?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Mar 30 18:36:03 EST 2005

I did something like this about two years ago when I tried to make a 
mod_python based streaming server as a proof of concept. I still have the 
code somewhere, may be some day it'll be cleaned up and released.

I used an mmap file that I called a "cuecard". A child that would be 
dedicated to writing was called a "prompter" and a process that read the 
cuecard and sent the data to the client was called an "actor".

To syncronize reads and writes to the cuecard I used the apache.mpm_query 
to figure out whether we're multithreaded and then based on that either 
used the fcntl or the threading modules for locking.

It all wasn't terribly complicated and worked quite well actually. I 
really with I had more time to dust this thing off...


On Wed, 30 Mar 2005, jonk wrote:

> Hi y'all, my first post.
> I'm running mod_python 3.1.3 (I think) on FC3. Now I was
> wondering that is it possible for interpreters (surely mixing
> things here but please read along if you can stand it) to share
> data, and in what way(s)?
> I would like to have one interpreter (the master) to grab
> video data, and others to feed it to clients. So this master
> would take care of video data buffer, and also it would need
> to pass data to and from slave interpreters (again, terms
> a still somewhat fuzzy to me). Also some kind of mutex
> system would be handy.
> If I did this in C, it would be really simple multithreaded
> program. But I don't want to write stand alone web server
> for this purpose, and I want to learn new things.
> So, to sum up, how to do inter process communications
> in mod_python?
>    Jonk
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list