All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Krzysztof Benedyczak <golbi@mat.uni.torun.pl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] POSIX message queues - syscalls & SIGEV_THREAD
Date: Tue, 18 Nov 2003 12:47:54 +0000	[thread overview]
Message-ID: <20031118124754.GA23333@mail.shareable.org> (raw)
In-Reply-To: <Pine.GSO.4.58.0311181254490.27011@Juliusz>

Krzysztof Benedyczak wrote:
> I'm afraid not ;-). In our case there can happen two situations after
> setting notification: 1) (normal) notification event that have to be
> serviced 2) cancellation of notification - when thread which some time ago
> set notification resigns from it. In general it is only important that we
> need a possibility to "signal" userspace with 2 different values.

You can just store the different values in userspace before signalling
the futex wakeup, can't you?

> >     5. If any are different, close() the fds and return "did not sleep".
> ------>hole
> >     6. Call poll() on the list of fds to wait until one becomes ready.
> >     7. close() the fds and return "woken".
> 
> If I understand you in the right way - yes it is important. The very
> simple situation - we have two futexes. One wakeup on first
> futex happen between 5. and 6. On the futex number 2 never. Or after an
> hour.

You are setting the first futex's word in userspace prior to the first
futex wakeup, right?  Either 5 will detect that and return
immediately, or it will reach 6 and the poll() returns immediately.
No hole there.

( The async token passing flaw is that the _waker_ loses track of how
many succesful wakeups it has sent; this is used by some
implementations of fair semaphores, among other things.  That might be
relevant to POSIX message queues but I do not see that it's relevant
to the two futex problem you described. )

-- Jamie

  reply	other threads:[~2003-11-18 12:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-16 14:57 [PATCH] POSIX message queues - syscalls & SIGEV_THREAD Krzysztof Benedyczak
2003-11-16 15:35 ` Manfred Spraul
2003-11-17 13:57   ` Krzysztof Benedyczak
2003-11-17  6:48 ` Jamie Lokier
2003-11-17 14:58   ` Krzysztof Benedyczak
2003-11-17 15:33     ` Jamie Lokier
2003-11-17 19:18       ` Ulrich Drepper
2003-11-17 21:13         ` Jamie Lokier
2003-11-18 12:20       ` Krzysztof Benedyczak
2003-11-18 12:47         ` Jamie Lokier [this message]
2003-11-21 11:40           ` Krzysztof Benedyczak
2003-11-17 19:07     ` Ulrich Drepper
2003-11-17 21:14       ` Jamie Lokier
2003-11-17 21:30         ` Randy.Dunlap

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=20031118124754.GA23333@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=golbi@mat.uni.torun.pl \
    --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 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.