Having multiple instances of a single application start a single instance of another one

buffinator buffinator at mymail.com
Fri Feb 23 17:49:17 EST 2007


Troy Melhase wrote:
>> The first time A starts, it should open a B process and start
>> communicating with it. All other times an A instance starts it should
>> simply talk with the B that already is open.
> 
> B should write its process id to a location known by both
> applications.  When A starts, it should read that PID from the file
> and attempt to communicate with the process having that PID.
> 
> When B starts, it should also check for the file.  If it's found and
> if the PID in it is present in the process table, then B should exit.
> Otherwise, it should start normally and write its own PID to the file.

Three very simple questions then.

1. How do I find out a running applications process ID

2. How do I check if a process ID is bound to a running application.

3. There won't be any issues with different applications trying to read 
and write the same file doing this?

/buffis



More information about the Python-list mailing list