mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tom Burns" <tom.i.burns@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Clarification re: outstanding IPC flaws
Date: Mon, 26 Nov 2007 12:01:22 -0500	[thread overview]
Message-ID: <671c20540711260901w6662fcabv779ce4fc51ec3d14@mail.gmail.com> (raw)

Hi List,

  Reading current kernel git ipc/sem.c I see the following comment:

--
 * - The previous code had two flaws:
...
 *   2) It did not wake up all zero waiting processes. We try to do
 *      better but only get the semops right which only wait for zero or
 *      increase. If there are decrement operations in the operations
 *      array we do the same as before.

--

I have some questions about this comment.

Most importantly - does this mean that if I have multiple processes
queued inside semop() calls with sem_val = -1 (also, if it matters,
SEM_UNDO flag is set), I can expect to eventually see none of the
queued processes woken up when whoever has the semaphore releases it?

If that's the case, is there any semop best-use example I should be
following for multiple multi-threaded processes sharing multiple
semaphores?

Currently I have some globally reachable semaphores doing semop calls
with SEM_UNDO.  They usually work fine with multiple processes waiting
on each other to lock the semaphore, but under certain circumstances a
semaphore will be released and none of the processes waiting on the
semaphore will be woken up.

Thanks in advance,
Tom Burns
Software Developer

             reply	other threads:[~2007-11-26 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 17:01 Tom Burns [this message]
2007-11-26 17:05 ` Tom Burns

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=671c20540711260901w6662fcabv779ce4fc51ec3d14@mail.gmail.com \
    --to=tom.i.burns@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®