linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elie De Brauwer <eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] recvmmsg.2 Updated timeout documentation
Date: Sun, 23 Dec 2012 21:42:20 +0100	[thread overview]
Message-ID: <50D76CAC.7070403@gmail.com> (raw)
In-Reply-To: <CAKgNAkhFS_n4BrTvqV12VcLSPXGjkBE6MOFS-sUCnCT8y7Pjfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 12/23/2012 07:30 PM, Michael Kerrisk (man-pages) wrote:
> Elie,
>
>> In any case, when operating in non-blocking mode, the timeout is taken into
>> account, which could mean that recvmmsg() returns while data is still
>> available (which was not clearly stated). (Combination of much data to
>> copy and a very sharp timeout).
>
> Can you say more about what you see/understand with nonblocking mode.
> I don't understand what you mean here (and it doesn't fit with what I
> am seeing on testing). Nonblocking mode should, I believe, always mean
> an immediate return, regardless of any timeout.

It's just cosmetics really, now they state that:
"
A nonblocking call reads as many messages as are available (up to the 
limit specified by vlen) and returns immediately.
"

Suppose that you are operating in non-blocking mode, the timeout is set 
to one nanosecond (yeah, living on the edge), and vlen is an insane 
large number (say a thousand) whilst assuming that data is available to 
be received. The text from the manpage says that you will return if the 
available data is depleted or if you have read 'vlen' buffers. So it 
means there's a 'faster than timeout' possible.

What the kernel implementation actually does (simplified, and ignoring 
WAITFORONE) is:

while(datagrams < vlen) {
   err = recvmsg()
   if (err) break;
   if (timeout) break;
   datagrams++
}

Both in non-blocking/blocking mode, and I think the manpage should make 
the three possible exit scenario (vlen, timeout, err) clear in both 
blocking and non-blocking mode.

gr
E.

-- 
Elie De Brauwer

--
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

      parent reply	other threads:[~2012-12-23 20:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 22:37 [PATCH] recvmmsg.2: correct since fields and correct specification of the timeout parameter Elie De Brauwer
     [not found] ` <1355956627-5676-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23  9:23   ` Michael Kerrisk (man-pages)
     [not found]     ` <CAKgNAkhz1E8c2jpECcYrKJyMv1RB36qC_HjW9s=i=+bYLfii4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-23 11:47       ` [PATCH] recvmmsg.2 Updated since fields for recvmmsg and MSG_WAITFORNONE Elie De Brauwer
     [not found]         ` <1356263235-4803-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23 17:50           ` Michael Kerrisk (man-pages)
2012-12-23 12:06       ` [PATCH] recvmmsg.2 Updated timeout documentation Elie De Brauwer
     [not found]         ` <1356264415-5108-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23 18:30           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkhFS_n4BrTvqV12VcLSPXGjkBE6MOFS-sUCnCT8y7Pjfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-23 20:42               ` Elie De Brauwer [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=50D76CAC.7070403@gmail.com \
    --to=eliedebrauwer-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).