From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Question : Broadcast Inter Process Communication ?
Date: Fri, 17 May 2002 14:30:52 -0700 [thread overview]
Message-ID: <20020517143052.A30047@bougret.hpl.hp.com> (raw)
Hi everybody,
I was looking under Linux for a mechanism to distribute an
event from one process (a daemon) to a set of other processes (deamons
or applications). The number and indentity of those other processes
would not be known by the process generating the event, those
processes would register themselves dynamically to the stream of
event. And the event need to be delivered to all of them (not only the
first one).
In other words, it would look like a *broadcast* message
queue, where the sender process would create the queue and write
events to it, and the other bunch of processes would dynamically open
the queue and listen for events.
My first attempt was with IPC message queues, but my
experimentations show that only the first receiver get the message. It
is pretty clear that no amount of tweaking will get the IPC message
queue to behave like that : IPC message queues don't have a notion of
receiver session, so can't send message to all receivers.
I can't use signals because signals are unicast, and I don't
want the sender to have to manage a list of processes it has to send
signals to. Also, signals don't have payload and are synchronous.
Unix sockets don't have a broadcast mode, and therefore are
limited to a single receiver (actually, I think you can only have one
sender). In theory, you could implement a broadcast mode for Datagram
sockets using the current API, it's just not done today.
I don't really want to use a UDP broadcast socket for
efficiency reason (and also because I don't want those events to go
accidentally over the network, or beeing succeptible to receive
spoofed events from the network). Also, it require the network stack
to be active and properly configured. But I must admit a UDP broadcast
on the loopback does pretty much what I need.
Failing that, I could hack a kernel module to do that, but I
don't want to re-invent the wheel...
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 ?
Thanks in advance...
Jean
next reply other threads:[~2002-05-17 21:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-17 21:30 Jean Tourrilhes [this message]
2002-05-18 1:52 ` Olaf Dietsche
2002-05-18 1:57 ` Jean Tourrilhes
2002-05-18 3:04 ` Alan Cox
2002-05-18 2:54 ` Jean Tourrilhes
2002-05-18 3:23 ` Alan Cox
2002-05-20 17:03 ` Maksim (Max) Krasnyanskiy
2002-05-21 8:00 ` Peter Wächtler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020517143052.A30047@bougret.hpl.hp.com \
--to=jt@bougret.hpl.hp.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jt@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®