Using "pickle" for interprocess communication - some notes and things that ought to be documented.
nagle at animats.com
Fri Jan 18 07:32:25 CET 2008
Irmen de Jong wrote:
> Christian Heimes wrote:
>> John Nagle wrote:
>>> It's possible to use "pickle" for interprocess communication over
>>> pipes, but it's not straightforward.
>> IIRC the processing module uses pickle for IPC. Maybe you can get some
>> idea by reading its code?
"Processing" is useful, but it uses named pipes and sockets,
not ordinary pipes. Also, it has C code, so all the usual build
and version problems apply.
> So does Pyro: http://pyro.sourceforge.net/
> However Pyro uses TCP-IP sockets for communication.
> It uses a small header that contains the size of the message and a few
> other things, and then the (binary by default) pickle stream.
I'd thought I might have to add another layer of encapsulation to
delimit "pickled" sections, but it turns out that's not necessary.
So it doesn't take much code to do this, and it's all Python.
I may release this little module.
More information about the Python-list