Python Forum

Full Version: code pattern for process communication
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The parent process could create a small file in a well known location (~/.my-program/process.pid, perhaps) at startup, where it writes it's own pid, so any spawning process can find it easily.  Or, you could just spam the signal to all python processes running, and hope the other ones just ignore it :p
memory mapped file object might be a help here. It can interchange data between parent and child processes.

I also found this list of python native modules for helping interprocess communication but didn't understand half of the modules.
there are a lot of options when two processes want communicate with each other.  but the issue for me is how to find that other process first.  my concern is that when looking by name, the name of what was executed might be just "python".
Pages: 1 2