Using "pickle" for interprocess communication - some notes and things that ought to be documented.

Paul Boddie paul at boddie.org.uk
Sat Jan 19 11:11:32 EST 2008


On 19 Jan, 17:06, John Nagle <na... at animats.com> wrote:
> Paul Boddie wrote:
> > Unlike your approach, pprocess employs the fork system call.
>
>      Unfortunately, that's not portable.  Python's "fork()" is
> "Availability: Macintosh, Unix."  I would have preferred
> to use "fork()".

There was a discussion some time ago about providing a fork
implementation on Windows, since Cygwin attempts/attempted to provide
such support [1] and there's a Perl module which pretends to provide
fork (using threads if I recall correctly), but I'm not sure whether
anyone really believed that it was workable. I believe that on modern
releases of Windows it was the ZwCreateProcess function which was
supposed to be usable for this purpose, but you then apparently have
to add a bunch of other things to initialise the new process
appropriately.

Of course, for the purposes of pprocess - providing a multiprocess
solution which should be as easy to use as spawning threads whilst
having some shared, immutable state hanging around that you don't want
to think too hard about - having fork is essential, but if you're
obviously willing to split your program up into different components
then any of the distributed object technologies would be good enough.

Paul

[1] http://www.cygwin.com/ml/cygwin/2002-01/msg01826.html



More information about the Python-list mailing list