linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Network Nut" <sillystack@gmail.com>
To: "'Austin S. Hemmelgarn'" <ahferroin7@gmail.com>,
	"'Clemens Ladisch'" <clemens@ladisch.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: RE: WaitForMultipleObjects/etc. In Kernel
Date: Fri, 31 Jan 2014 16:35:05 -0600	[thread overview]
Message-ID: <007d01cf1ed4$b0e659a0$12b30ce0$@gmail.com> (raw)
In-Reply-To: <52EBD7BC.5020704@gmail.com>

> -----Original Message-----
> From: Austin S. Hemmelgarn [mailto:ahferroin7@gmail.com]
> Sent: Friday, January 31, 2014 11:05 AM
> To: Network Nut; 'Clemens Ladisch'
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: WaitForMultipleObjects/etc. In Kernel

> >> Network Nut wrote:
> > I was thinking that, rather than as for specifics, I should present my general
> problem, and ask how long-time Linux experts would solve it.
> >
> > I have a master process M, that executes continually, from the birth to
> death of user-session.
> >
> > I have many (distinct) processes that will be launched, and these
> processes, P1, P2, ...Pn, expect to see that M is executing. These processes:
> >
> > 1. expect to have access to a shared-memory section that already exists
> because M created it
> > 2. expect to use a semaphore that already exists because M created it
> > 3. expect to use a mutex that exists because M created it
> >
> > P1, P2, ...Pn all know the path of image on disk of M. They are also
> permitted to maintain a fixed string that can be used to "get at" the mutex
> and semaphore.
> >
> > How would P1, P2, ...Pn get at the semaphore that M created?
> >
> > Please note that M cannot have any prior knowledge at all of P1, P2, ...Pn.
> P1...etc. must initiate  communication with M.
> >
> > [I don't want to misuse/abuse linux-kernel with my personal questions, so
> if there is a more appropriate group, please let me know.]
> >
> > Regards,
> >
> > -Net
> Assuming that you're porting to mainline distributions (and not embedded
> devices), named SHM segments are accessible (providing the accessing
> process has correct permissions) under /dev/shm.  You just need to make
> sure that you create the segment with the right permissions for the
> other processes to access it.

Thanks, Austin.

I already know how to do named shared memory between two processes. I only included that to describe my overall problem.

The problem that I am having is how I can make three totally-independent processes interact:

1. M is a master process that creates a semaphore.
2. P1 is a process that operates against the semaphore.
3. P2 is a process that operates against the semaphore.
4. It is not permissible that M be responsible for launching P1 or P2.
5.  The semaphore, one way or another, must allow itself to be specified as one of the synchronization primitives in epoll_wait()

How do I do this?

-Nut


  reply	other threads:[~2014-01-31 22:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 22:01 WaitForMultipleObjects/etc. In Kernel Network Nut
2014-01-26 18:33 ` Clemens Ladisch
2014-01-26 22:10   ` Network Nut
2014-01-27  9:06     ` Clemens Ladisch
2014-01-27 19:50       ` Network Nut
2014-01-28  9:04         ` Clemens Ladisch
2014-01-28 21:07           ` Network Nut
2014-01-29  8:30             ` Clemens Ladisch
2014-01-30 23:49               ` Network Nut
2014-01-31 17:05                 ` Austin S. Hemmelgarn
2014-01-31 22:35                   ` Network Nut [this message]
2014-01-31 22:53                     ` Clemens Ladisch
2014-01-31 23:00                       ` Network Nut
2014-01-31 23:08                         ` Network Nut

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='007d01cf1ed4$b0e659a0$12b30ce0$@gmail.com' \
    --to=sillystack@gmail.com \
    --cc=ahferroin7@gmail.com \
    --cc=clemens@ladisch.de \
    --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;
as well as URLs for NNTP newsgroup(s).