Re: disk-based fds in select/poll

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Mon Jun 04 2001 - 18:16:29 EST


> Ok, so while knowing about select "lying" about readability of a file
> fd, if I would stick a file fd in my select-based loop anyway, but would

You could fix select to return when the page was cachied and return EWOULDBLOCK
on reads if the page was not present to be honest. I don't think that would
actually break any apps, and the specs seem to allow it

> only try to read a bit at a time (say, 4K or 8K) would trigger
> readahead, yet finish quickly enough that I can get back to processing
> other fds in my select loop?

Probably

> Wouldn't that cause too many syscalls to be done? Or if this is actually
> the way to go without an actual thread, how should I go determining an
> optimal block size?

fs block size I suspect or small multiple thereof

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



This archive was generated by hypermail 2b29 : Thu Jun 07 2001 - 21:00:32 EST