Interprocess communication: which scenario?

C

Charles Packer

I need to do the following simple interprocess communication (IPC) among these
processes that are all on the same box:
-- A daemon waits for "I'm here" announcements from multiple clients
-- One or more clients send an "I'm here" to the daemon upon command
via the client's GUI (Each client's GUI is viewed by a different
human user)
The daemon retransmits "X is here" to all clients when it receives any "I'm here".

I read some tutorials on message queues and sockets and have tried their examples,
but that's the extent of my experience in this area. Since I'm going to have
to invest a significant amount of time learning molecular-level trivia about
IPC to implement the application in C, I'd like some opinions as to which IPC
scenario -- sockets, message queues, etc. is most appropriate for my application
model.
 
S

SnaiL

Charles said:
I need to do the following simple interprocess communication (IPC) among these
processes that are all on the same box:
Ok

-- A daemon waits for "I'm here" announcements from multiple clients
Daemon may listen socket/pipe for these messages
-- One or more clients send an "I'm here" to the daemon upon command
via the client's GUI (Each client's GUI is viewed by a different
human user)
These clients will send this message to server's socket/pipe
The daemon retransmits "X is here" to all clients when it receives
any "I'm here".
The server can do it by using multicast notifications
I read some tutorials on message queues and sockets and have tried their examples,
but that's the extent of my experience in this area. Since I'm going to have
to invest a significant amount of time learning molecular-level trivia about
IPC to implement the application in C, I'd like some opinions as to which IPC
scenario -- sockets, message queues, etc. is most appropriate for my application
model.

There is one of many opinios :)
 
D

dandelion

First off, this is *off* topic on this ng. Having said that (to appease ye
daemons of c.l.c.)
I need to do the following simple interprocess communication (IPC) among these
processes that are all on the same box:
^^^^^^^^^^^
-- A daemon waits for "I'm here" announcements from multiple clients
-- One or more clients send an "I'm here" to the daemon upon command
via the client's GUI (Each client's GUI is viewed by a different
human user)
The daemon retransmits "X is here" to all clients when it receives any
"I'm here".

Ok.
I read some tutorials on message queues and sockets and have tried their examples,
but that's the extent of my experience in this area. Since I'm going to have
to invest a significant amount of time learning molecular-level trivia about
IPC to implement the application in C, I'd like some opinions as to which IPC
scenario -- sockets, message queues, etc. is most appropriate for my application
model.

Since all your processes are on the same box, i'd suggest a named pipe. They
are the
simplest method of IPC I know of yet are very usable. If you supply the
server and all
the clients with some unique id, you only need 2 pipes (they are
half-duplex), since writes
to pipes are guaranteed to be atomic (POSIX). Furthermore, they are
supported over a
range of OS's.

See
http://developers.sun.com/solaris/articles/named_pipes.html
http://librenix.com/?inode=4423
 
C

CBFalconer

Charles said:
I need to do the following simple interprocess communication (IPC)
among these processes that are all on the same box:
-- A daemon waits for "I'm here" announcements from multiple clients
-- One or more clients send an "I'm here" to the daemon upon command
via the client's GUI (Each client's GUI is viewed by a different
human user)
The daemon retransmits "X is here" to all clients when it receives
any "I'm here".

I read some tutorials on message queues and sockets and have tried
their examples, but that's the extent of my experience in this area.
Since I'm going to have to invest a significant amount of time
learning molecular-level trivia about IPC to implement the application
in C, I'd like some opinions as to which IPC scenario -- sockets,
message queues, etc. is most appropriate for my application model.

Those things are all system specific extensions to the C language,
and thus are off topic on c.l.c. where discussion is limited to
things defined by the various ISO C standards. In some respects
comp.programming might be suitable, but I suspect you have already
selected the optimum newsgroup in c.u.p. F'ups set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top