Inter-process communication, how? Part 2

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Mon Dec 24 06:54:49 EST 2007


Hendrik van Rooyen wrote:
> <ecir.hana at gmail.com> wrote:
 
>> What I don't like about FIFO, is that on Unix they are persistent
>> files. So whatever happens to Manager they would stay there...
>> I was just wondering if there's another way of doing the above
>> and if not, I would probably go with FIFO. Thanks!
> 
> The persistence bit is true, and can lead to puzzling behaviour
> when you are still debugging, as the recipient can get a mix of
> old and new data after a crash.
> 
> It is probably best to delete them and create them for every run,
> either in a BASH script, or in the Python programme that first
> opens the pipe.

You could also drain the pipe in a script using 
"cat <pipe-goes-here>".

> As for the alternative, on Linux, sockets seem to hang around for
> a while after a run, until the OS deletes them, so that repetitive
> execution can give you a socket in use error.

In my experience this only happens if you kill the program. If it
terminates normally it should close its socket so it is "freed"
immediately.

Grüße,


Björn

-- 
BOFH excuse #422:

Someone else stole your IP address, call the Internet detectives!




More information about the Python-list mailing list