mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Newall <davidn@davidnewall.com>
To: Kyle Hubert <khubert@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SysV IPC message queues
Date: Tue, 23 Mar 2010 05:32:11 +1030	[thread overview]
Message-ID: <4BA7BEB3.9040105@davidnewall.com> (raw)
In-Reply-To: <9a158e2e1003220146p463e35b6u2615695ae9ddc1b9@mail.gmail.com>

Kyle,

Processes do not open nor close message queues, rather they place 
messages on and fetch them from queues.  Let me say this again: you do 
not open a queue like you must for a file, but go directly to the 
equivalent of read and write.  There is no refcount to indicate how many 
processes are "using" a queue, although there may be one indicating how 
many are actively waiting to receive a message.  Removing a queue when 
that count reaches zero would be quite wrong because a process stops 
waiting as soon as it receives a message; so the count would be zero 
more often than not.

Do not allow IPC_PRIVATE to lead you into false understanding of what a 
message queue is.  IPC_PRIVATE does not cause creation of a private 
queue, as indicated in msgget(2): "The name choice IPC_PRIVATE was 
perhaps unfortunate, IPC_NEW would more clearly show  its  function."  
Queues are not accessed by key but by id.  You do not need to know the 
key for a queue to access it, neither do you need to use msgget(2) to 
find a queue's id.

So, no, sorry, but your idea must be rejected.

David

      reply	other threads:[~2010-03-22 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22  2:28 Kyle Hubert
2010-03-22  8:46 ` Kyle Hubert
2010-03-22 19:02   ` David Newall [this message]

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=4BA7BEB3.9040105@davidnewall.com \
    --to=davidn@davidnewall.com \
    --cc=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

Powered by JetHome