Messages in this thread | | | Subject | Re: [patch rfc] towards supporting O_NONBLOCK on regular files | From | James Antill <> | Date | Thu, 21 Oct 2004 16:14:43 -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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |