All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Daniel <daniel.jacob.samuel@gmail.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai@xenomai.org
Subject: Re: Look up all IDDP/XDDP labels in the registry from userspace
Date: Tue, 26 Jan 2021 11:44:37 -0800	[thread overview]
Message-ID: <CAPMj8Mtgv3FzX9H8ZRc9jCZsp8u6RhuyjXGJkbpfK6UoneNQVA@mail.gmail.com> (raw)
In-Reply-To: <8ebae193-88ec-e4b1-d86b-642a594ac7da@siemens.com>

On Tue, Jan 26, 2021 at 10:07 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:

> On 25.01.21 22:07, Sam Daniel via Xenomai wrote:
> > On Mon, Jan 25, 2021 at 12:20 PM Sam Daniel <
> daniel.jacob.samuel@gmail.com>
> > wrote:
> >
> >> Is it possible to look up from userspace code all of the IDDP/XDDP
> labels
> >> that exist in the registry without leaving the primary domain?
> >>
> >> I have tried a few different ways of reading the contents of
> >> /proc/xenomai/registry/rtipc/iddp. The inotify API causes mode switches
> (it
> >> relies on select or poll), not to mention that inotify does not work
> well
> >> with virtual filesystems. And using the C++ filesystem library to read
> the
> >> contents of the directory also causes mode switches (filesystem
> >> interactions).
> >>
> >> Is there a real-time API function that I can use to query these labels?
> >>
> >
> > C++ filesystem library is causing mode switches because of an mmap deep
> in
> > its call stack, not because of "filesystem interactions" like I initially
> > thought.
> >
>
> What is the use case you need label listing from RT context for?
>
> Jan
>
> --
> Siemens AG, T RDA IOT
> Corporate Competence Center Embedded Linux
>

My use case is an IDDP-based pub/sub messaging system for real-time threads.

Threads publish and subscribe to a channel ("xyz"). Any number of threads
can publish to any channel. And any number of threads can subscribe to any
channel (and each one should receive every message published to that
channel).

Subscribers bind labeled IDDP sockets for each channel using labels like
so: <channel name>-<thread name>. If three threads subscribe to channel
"xyz" then I would expect /proc/xenomai/registry/rtipc/iddp to show:
xyz-threadA -> 0
xyz-threadB -> 1
xyz-threadC -> 2

For the pub/sub implementation to work, when thread X calls publish("xyz",
&message) the publish method would need to multicast the message to all
three of the IDDP sockets above.

I would like to look up all labels in the registry from within the publish
method to check if any subscribers have gone away or if any new subscribers
have appeared and then adjust the multicast of the message accordingly.

  reply	other threads:[~2021-01-26 19:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 20:20 Look up all IDDP/XDDP labels in the registry from userspace Sam Daniel
2021-01-25 21:07 ` Sam Daniel
2021-01-26 18:07   ` Jan Kiszka
2021-01-26 19:44     ` Sam Daniel [this message]
2021-01-26 20:00       ` Jan Kiszka
2021-01-26 20:37         ` Sebastian.Smolorz
2021-01-27  6:24       ` Philippe Gerum

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=CAPMj8Mtgv3FzX9H8ZRc9jCZsp8u6RhuyjXGJkbpfK6UoneNQVA@mail.gmail.com \
    --to=daniel.jacob.samuel@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.