From: "Network Nut" <sillystack-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "'Michael Kerrisk (man-pages)'"
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: RE: FW: WaitForMultipleObjects/etc. In Kernel
Date: Thu, 30 Jan 2014 14:04:30 -0600 [thread overview]
Message-ID: <007c01cf1df6$7ccbe010$7663a030$@gmail.com> (raw)
In-Reply-To: <52E8DA80.7080204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> -----Original Message-----
> From: Michael Kerrisk (man-pages) [mailto:mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
> Sent: Wednesday, January 29, 2014 4:40 AM
> To: Network Nut
> Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: FW: WaitForMultipleObjects/etc. In Kernel
>
> On 01/27/2014 10:21 PM, Network Nut wrote:
> > See below.
> >
> > -----Original Message-----
> > From: Clemens Ladisch [mailto:clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org]
> > Sent: Monday, January 27, 2014 3:07 AM
> > To: Network Nut
> > Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > Subject: Re: WaitForMultipleObjects/etc. In Kernel
> >
> >> BTW, the man page for epoll_wait seems to be incorrect.
> >
> > <https://www.kernel.org/doc/man-pages/reporting_bugs.html>
> >
> >> "The timeout argument specifies the minimum number of milliseconds
> >> that epoll_wait() will block."
> >>
> >> I think the word "minimum" should be "maximum".
>
> I've removed the word "minimum" from the sentence. Note that
> "maximum" would not be correct. See the surrounding text for an
> explanation of why.
>
> Thanks for the report.
>
> Cheers,
>
> Michael
Hi Michael,
I re-read the sentence with the word "minimum" being removed. It makes sense
now, at least for those of us who already understand how it should work
[WaitForMultipleObjects]. But I wonder....Imagine a programmer who is
relatively new to synchronization, just discovering the power of waiting for
multiple fd's. Reading that statement, s/he might be inclined to believe
that the function really will wait, say, 1000 milliseconds, without regard
for signaling state of any of the fd's that might transition during the call
to epoll_wait. The reason would be that s/he has no reason to believe
otherwise, as that is what the man page says. By contrast, those of us who
already know the nature of this function would not be confused because we
would think, "Ok, I know that epoll_wait will not actually wait 1000 ms in
all cases, but ..."
Not trying to teach the teacher here. :) Just saying'. [Yes, it's a
nit-pick.]
Since we are on the subject, I also believe that the man page for epoll_wait
should state whether sequence of the signaled fd's is guaranteed to be
correlated to the order in which they were specified. As you know, there are
many situations where programmer might want to wait on, say, eventfd that
says that thread should exit, plus four other semaphores, etc. If the four
other semaphores guard queues that are, in general, never empty, then on
each loop, the semaphores will be triggered. If then, on one of the loops,
the eventfd for "exit" is triggered, there is no guarantee, according to the
man page, that the "exit" eventfd will be returned in the triggered-set. It
would seem natural that, if the "exit" eventfd is added to the first
position with epoll_ctl, then of any trigger-set where "exit" eventfd is
set, that "exit" eventfd ~must~ be included as a matter of explicit
prioritization. Guaranteeing a correlation between specified order in
epoll_ctrl and yielded order in epoll_wait would allow the programmer to
specify maxevents=1 to epoll_wait, at which point, the "exit" eventfd, if
triggered, would preempt any of the semaphores.
Or...maybe I am missing something else?
-Nut
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-30 20:04 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
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 [this message]
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='007c01cf1df6$7ccbe010$7663a030$@gmail.com' \
--to=sillystack-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.