Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHSMefiLDxRJMFstWOysSmApqZeX296e1+uxhNVzL7SXjoLQdw@mail.gmail.com>
Date: Tue, 15 Oct 2019 10:04:47 -0700
From: Leonid Shamis <leonid.shamis@...il.com>
To: musl@...ts.openwall.com
Subject: broadcast fd

Hi Folks,

TLDR:

How do I broadcast a notification across processes, without a broker?

Long story:

I'm building an ipc-over-shm library with some unusual restrictions:
* There are multiple channels of communication (each in it's own shm).
* Each channel contains non-consumable resources (not a message queue).
* Multiple processes can produce resources on the same channel.
* Multiple consumers can access/use the resources.
* Resources are versioned and (some) old versions are kept available.
* Spurious wakeups are ok, but missing notifications (starvation) is not.
* The library must be robust (in the mutex sense), meaning a process may
crash without taking down the rest of the system.

I'm trying to figure out how to notify a process that a new resource is
available on a channel.

Right now, my library puts (the equivalent of) a robust conditional
variable in shared memory, for each channel.
Each process must spawn a thread per-channel, just to await the cv
broadcast.

I'd ideally like to use a single thread with something like an epoll.
For this, I'd need to get an fd (maybe eventfd) per channel into the hands
of every process that wants to connect to a channel.
fds, as I understand, cannot be shared via shared memory, only pipes, but
I'm required to be brokerless.
futex_fd are very deprecated.

Am I missing another approach?

Thanks,
--Leo

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.