Re: IPC from series of processes to single async process networking process
- From: Rainer Weikusat <rainer.weikusat@xxxxxxxxx>
- Date: Thu, 04 Jan 2007 11:59:03 +0100
"Mr. Uh Clem" <uhclem@xxxxxxxxxxxxxxxxxx> writes:
[ description of problem deleted ]
So, after all that intro, my question is about how best to do the
IPC between the (sequence of) com process(es) and the CM process.
This feels like a job for named pipes or unix domain sockets. (I've
used neither before.) The main concern is how a com process will
atomically determine whether the CM process is (still) running.
Seems like there is a race condition if the CM process is exiting
just as a new com process fires off.
This is easy. You could use an AF_UNIX SOCK_STREAM. The com process
would try to connect to a 'well known address' and this connect should
only succeed after the CM process has accepted the connection (and you
will get an error or a SIGPIPE if you wrote to a stream-socket whose
other end has gone away). But you will need to serialize multiple
com processes trying to start a CM process concurrently. That could be
done by using a lockfile, preferably with actual record or file
locking.
.
- Follow-Ups:
- References:
- IPC from series of processes to single async process networking process
- From: Mr. Uh Clem
- IPC from series of processes to single async process networking process
- Prev by Date: Re: Create permissions
- Next by Date: Re: Create permissions
- Previous by thread: Re: IPC from series of processes to single async process networking process
- Next by thread: Re: IPC from series of processes to single async process networking process
- Index(es):
Relevant Pages
|