Re: Question : Broadcast Inter Process Communication ?

Peter Wächtler (pwaechtler@loewe-komp.de)
Tue, 21 May 2002 10:00:06 +0200


Maksim (Max) Krasnyanskiy wrote:
>
>> > That's exactly why I don't want to deal with it myself.
>> > However, the kernel deal with it all the time, and do it
>> > well. For example RtNetlink event have this property (except that they
>> > are kernel => process instead of beeing process => process).
>>
>> By sending one copy of the message to each target. Its how everyone does
>> it except for special cases. Reliable multi-delivery is -hard-
>
>
> I was gonna suggest the same thing. Why not just have a simple event
> server based on unix sockets.
> This server would listen on unix stream socket. Clients interested in
> events would connect to it.
> All the server has to do is copy event to all connected clients.
> Server code is very simple. About 20 lines, everything in a single
> thread, if you use GLib's event loop.
>

If using a central "server" process, all clients have to copy
the message to the server - then the server copies the messages
to multiple clients.

I can imagine a library, that holds a registry in shared mem, and
the clients look for themselves to whom to copy the message.
For this I want to use posix message queues to avoid lots of
context switches and copies.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/