All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Network Nut <sillystack@gmail.com>,
	"'Clemens Ladisch'" <clemens@ladisch.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: WaitForMultipleObjects/etc. In Kernel
Date: Fri, 31 Jan 2014 12:05:00 -0500	[thread overview]
Message-ID: <52EBD7BC.5020704@gmail.com> (raw)
In-Reply-To: <00f201cf1e15$f134ce70$d39e6b50$@gmail.com>



On 01/30/2014 06:49 PM, Network Nut wrote:
>> -----Original Message-----
>> From: Clemens Ladisch [mailto:clemens@ladisch.de]
>> Sent: Wednesday, January 29, 2014 2:31 AM
>> To: Network Nut
>> Cc: linux-kernel@vger.kernel.org
>> Subject: RE: WaitForMultipleObjects/etc. In Kernel
>>
>> Network Nut wrote:
>>> I was looking at POSIX because it allows naming of the primitives.
>>
>> Linux uses two orthogonal mechanisms for synchronization primitives and for
>> naming/sharing.
>>
>>> I need to epoll_wait on inter-process {mutex, event, semaphore}.
>>
>> Use eventfd.
>>
>>> I need to reference inter-process {mutex, event, semaphore}, each
>>> identified by string, if feasible.
>>
>> Send the fd through a Unix domain socket.
> 
> Hi Again,
> 
> 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.

  reply	other threads:[~2014-01-31 17:05 UTC|newest]

Thread overview: 18+ 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 [this message]
2014-01-31 22:35                   ` Network Nut
2014-01-31 22:53                     ` Clemens Ladisch
2014-01-31 23:00                       ` Network Nut
2014-01-31 23:08                         ` Network Nut
     [not found]       ` <52E6219A.3020405-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2014-01-27 21:21         ` FW: " Network Nut
2014-01-29 10:40           ` Michael Kerrisk (man-pages)
     [not found]             ` <52E8DA80.7080204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-30 20:04               ` Network Nut
2014-01-31  6:56                 ` Michael Kerrisk (man-pages)

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=52EBD7BC.5020704@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sillystack@gmail.com \
    /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.