Re: Question : Broadcast Inter Process Communication ?

Jean Tourrilhes (jt@bougret.hpl.hp.com)
Fri, 17 May 2002 19:54:38 -0700


On Sat, May 18, 2002 at 04:04:52AM +0100, Alan Cox wrote:
> > This "one sender - multiple reader" model seems common and
> > usefull enough that there must be a way to do that under Linux. I know
> > that it exist under Windows. Can somebody help me to find out how to
> > do it under Linux ?
>
> Its actually a nontrivial construct - especially since readers can vanish
> and appear asynchronously during the lifetime of any event.

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).

> You could
> implement it with multiple linked lists of pointers to refcounted objects,
> and you could do that in user space (eg with shared memory), the chances
> are that for all but the most extreme cases sending a copy of the event to
> each listener is cheaper, simpler and more debuggable

Well, maybe I will simply use a UDP broadcast on the loopback,
it seems much simpler to me. I really wish there was broadcast Unix
sockets.

Regards,

Jean
-
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/