public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Antill <james.antill@redhat.com>
To: jmoyer@redhat.com
Cc: Alexandre Oliva <aoliva@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	"Stephen C. Tweedie" <sct@redhat.com>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	akpm@osdl.org
Subject: Re: [patch rfc] towards supporting O_NONBLOCK on regular files
Date: Thu, 21 Oct 2004 16:14:43 -0400	[thread overview]
Message-ID: <m3k6tjakwc.fsf@code.and.org> (raw)
In-Reply-To: <16755.62608.19034.491032@segfault.boston.redhat.com> (Jeff Moyer's message of "Mon, 18 Oct 2004 12:51:28 -0400")

Jeff Moyer <jmoyer@redhat.com> writes:

> Select, pselect, and poll will always return data ready on a regular file.
> As such, I would argue that squid's behaviour is broken.

 I would argue that this isn't true. Yes, poll() would always return
ready, but read would always "block" when you called it on the
files. And using the same method you use for network IO saves having
to have a separate path through the event loop just for reading files
from disk.
 For another view of the argument, see:

http://www.and.org/vstr/examples/ex_cat.c.html

...this does non-blocking IO from stdin to stdout. You seem to be
arguing that it should have to know when stdin is from a pipe and when
it is a redirected file.

> I am in favor of kicking off I/O for reads that would block.

 This would solve the problem, but I'd still argue that poll()
shouldn't lie ... having the event loop do the right thing when the
disk is busy or the file is on a down NFS server would be a huge free
win.

-- 
James Antill                               e: <james.antill@redhat.com>
Red Hat Support Engineering Group

  parent reply	other threads:[~2004-10-21 20:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 20:57 [patch rfc] towards supporting O_NONBLOCK on regular files Jeff Moyer
2004-10-03 19:48 ` Pavel Machek
2004-10-13 14:28   ` Jeff Moyer
2004-10-14 17:39     ` Pavel Machek
2004-10-05 11:27 ` Marcelo Tosatti
2004-10-06 13:13   ` Jeff Moyer
2004-10-06 12:01     ` Marcelo Tosatti
2004-10-07  3:31       ` Stephen C. Tweedie
2004-10-07 10:12         ` Marcelo Tosatti
2004-10-07 12:30           ` Arjan van de Ven
2004-10-11 18:32           ` Stephen C. Tweedie
2004-10-11 18:58             ` Jeff Moyer
2004-10-11 21:49               ` Stephen C. Tweedie
2004-10-13 14:26                 ` Jeff Moyer
2004-10-15 15:44                   ` Jeff Moyer
2004-10-15 16:19                     ` Stephen C. Tweedie
2004-10-17  7:59                     ` Alexandre Oliva
2004-10-17 11:20                       ` Ingo Molnar
2004-10-17 19:38                         ` Alexandre Oliva
2004-10-18 16:51                           ` Jeff Moyer
2004-10-19  6:04                             ` Alexandre Oliva
2004-10-21 20:14                             ` James Antill [this message]
2004-10-05 15:35 ` Rik van Riel
  -- strict thread matches above, loose matches on Subject: below --
2004-10-05 13:07 Dan Kegel

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=m3k6tjakwc.fsf@code.and.org \
    --to=james.antill@redhat.com \
    --cc=akpm@osdl.org \
    --cc=aoliva@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=mingo@redhat.com \
    --cc=sct@redhat.com \
    /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