From: Kyle Hubert <khubert@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: SysV IPC message queues
Date: Sun, 21 Mar 2010 19:28:32 -0700 [thread overview]
Message-ID: <9a158e2e1003211928y37d3bbfnac068f200128ddb6@mail.gmail.com> (raw)
Hi, I recently found myself using SysV IPC message queues in a Linux
specific application. However, I have one concern, I'm using
IPC_PRIVATE for the key to instantiate the message queue (then doing
pthread_creates with the open file descriptor accessed from children
threads).
Anyways, upon reception of signals, the message queue lingers around
taking up memory. I wouldn't mind this if I was using a key_t which I
could use to reopen the message queue at a later instantiation.
However, IPC_PRIVATE just grabs an available queue, and I don't have
access to the key, so I can't exactly open and remove it later. It's
my opinion that IPC_PRIVATE should cause the message queue to get
destroyed when all the open file descriptors are closed, not solely
when msgctl is used to remove it. Also, I don't want to capture
signals, since that's a slippery slope and SIGKILL will still leak
message queues. I also don't think ipcs/ipcrm are long term solutions,
since I'm handing the library off as an abstraction.
Would it be worth it to generate a patch to the Linux kernel to add
this functionality? Or, is there an undocumented ioctl I can call to
set that feature on?
IE: IPC_PRIVATE message queues should be freed when ref count drops to zero.
Thank you very much for your time,
-Kyle Hubert
next reply other threads:[~2010-03-22 2:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 2:28 Kyle Hubert [this message]
2010-03-22 8:46 ` Kyle Hubert
2010-03-22 19:02 ` David Newall
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=9a158e2e1003211928y37d3bbfnac068f200128ddb6@mail.gmail.com \
--to=khubert@gmail.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®