Re: IPC (process to multi-process)



On 7 Feb 2007 04:27:26 -0800, lm0309@xxxxxxxxx staggered into the Black
Sun and said:
Dances With Crows wrote:
lm0309@xxxxxxxxx wrote:
open the socket /dev/lircd for writing. lircd then reads information
from various remote controls and writes the info that it receives to
the socket.
If I understand correctly, this mechanims provides "broadcast"
capability [where] every process needs to filter out messages not
belonging to it. I'm intersted in "multicasting" capability.

"Multicasting" as used for IP is a red herring if all the processes are
on the same machine. Don't use that term if it doesn't apply; it'll
just confuse people.

What is it that you're trying to do? Details Count; you've been
pretty vague so far.
I need more ideas to solve the problem (it is a small embedded system
where all the processes [are] located on the same host).

This is *still* too vague to do much with. What are the processes
doing? What is the bottleneck, CPU speed or I/O speed? Did you write
the code yourself, did you get the code from somewhere else, can you
modify the code reasonably easily? The answers to those questions will
dictate what you do.

If the processes are on the same machine, why wouldn't sockets work?

If the processes are all on the same machine, local sockets are probably
the fastest IPC mechanism you're going to get. If you have events of
multiple types, you might have the server process open multiple sockets,
and send A events to /tmp/socketA , B events to /tmp/socketB , etcetera.

Or possibly POSIX shared memory may be easier to use in this case.
There, you'd just shm_open() an object in various processes, then mmap()
that object and read/write things via the void* you get back. This may
introduce synchronization problems if multiple processes are reading and
writing to the same segment, so you may want multiple shared memory
segments. Without more info on what it is that you're doing, it'll be
impossible to speak in any but the most general terms about what you
need to do here. HTH anyway,

--
I have had to deal with kangaroos, donkeys, cows, wild pigs
and some press leaks by former Vice President Cheney.
--MegaHAL, trained on ASR
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.



Relevant Pages

  • Re: Need help making a decision on gps purchase
    ... The zumos are motorcycle oriented but will work equally well in a car. ... If you pay attention to the numbers of waypoints and routes allowed on the different models, that will be your indicator of the multiple destination capability. ...
    (sci.geo.satellite-nav)
  • Re: Communications Between Program and Controlling Program
    ... Named pipes if you are working within a single Windows domain (or domains with mutual ... Sockets if you need to work across multiple domains. ... Also, no matter what your protocol is, make sure that you can handle multiple startup ...
    (microsoft.public.vc.mfc)
  • Re: CPU usage with UDP sockets
    ... multiple clients. ... library) UDP sockets that sends audio and video to the clients. ...
    (comp.os.linux.networking)
  • [PATCH 0/8 v4] PCI: Linux kernel SR-IOV support
    ... Following patches are intended to support SR-IOV capability in the ... is intended to enable multiple system software to share PCI hardware ... PCI device that supports this capability can be extended ...
    (Linux-Kernel)
  • Re: Reliable Winsock Control alternative
    ... You could use the form with the winsock control just as anny other class ... sockets created with CSocket are non-blocking sockets. ... BSD style functions. ... Or you can use the select function to perform multiplexing on multiple sockets ...
    (microsoft.public.vb.general.discussion)