Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Interprocess communication: which scenario?

Reply
Thread Tools

Interprocess communication: which scenario?

 
 
Charles Packer
Guest
Posts: n/a
 
      12-20-2004
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.
 
Reply With Quote
 
 
 
 
SnaiL
Guest
Posts: n/a
 
      12-20-2004
Charles Packer wrote:
> 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

 
Reply With Quote
 
 
 
 
dandelion
Guest
Posts: n/a
 
      12-20-2004

"Charles Packer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...

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/ar...med_pipes.html
http://librenix.com/?inode=4423



 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      12-20-2004
Charles Packer wrote:
>
> 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.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


 
Reply With Quote
 
mailbox@cpacker.org
Guest
Posts: n/a
 
      12-22-2004

dandelion wrote:
> See
> http://developers.sun.com/solaris/ar...med_pipes.html
> http://librenix.com/?inode=4423


Duly noted. Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Approaches of interprocess communication exhuma.twn Python 23 02-18-2007 02:33 PM
Interprocess communication on multi-user machine Michael Butscher Python 7 07-01-2006 10:49 AM
Interprocess communication and memory mapping James Aguilar Python 3 12-20-2005 08:48 AM
SystemVerilog Interprocess Communication - Project VeriPage Update Swapnajit Mittra VHDL 0 12-21-2004 05:11 PM
newbie question: interprocess communication Dave Bartlett ASP .Net 1 05-13-2004 01:27 AM



Advertisments