Re: sendfile() and NUMTHREADS questions

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 22 Dec 1999 01:09:12 +0100

Adrian Chadd wrote:

> It wouldn't have to - you might be able to just fob off a thread for each
> disk access you're doing, then call sendfile() inside that.

Each cache HIT more likely.

Would require quite a bit of redesign I think.. but it is a neat idea,
especially if if handles non-blocking sockets properly which would allow
a better thread resource utilisation by having each thread servicing
multiple clients.

A guess is that it is semantically equivalent to
mmap(file)+write(to_socket)+munmap(file), but without the overhead of a
mmap()+munmap().

> FreeBSD's sendfile() implements a non-blocking call too, although I haven't
> tried its usefulness out yet (ie how well it predicts you're going to read
> a file, although I'm guessing that its implementation WILL be faster ..)

My guess it that it is non-blocking in the same way as write() is. I.e.
returning as soon as the TCP window has been filled. It is most likely
NOT non-blocking disk access.

I see no evidence in the Linux man pages that the linux version handles
non-blocking sockets, but it could be a documentation error/omission.

/Henrik
Received on Tue Dec 21 1999 - 16:21:23 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:20 MST