Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 11:30:00 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Alfred Perlstein <bright@mu.org>
Cc:        Dominic Marks <dominic_marks@btinternet.com>, Kip Macy <kmacy@netapp.com>, Peter Wemm <peter@wemm.org>, Mike Silbersack <silby@silby.com>, Hiten Pandya <hiten@uk.FreeBSD.org>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: In-Kernel HTTP Server (name preference)
Message-ID:  <3C72A7B8.DD297F4E@mindspring.com>
References:  <20020219092058.A78717@host213-123-131-110.in-addr.bto> <Pine.GSO.4.10.10202190914510.25289-100000@cranford> <20020219175431.A12535@host213-123-131-110.in-addr.bto> <20020219180004.GO12136@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein wrote:
> Disk IO can't be done in a non-blocking manner.  If the kernel doesn't
> have the portion of the file you wish to read in the buffer cache
> then the process will block waiting.  There is simply nothing you
> can do about this other than to offload that blocking into another
> process context via kernel threads, posix aio or kses.

On SVR4, an attempt to access a non-resident page via a
non-blocking fd will result in a fault for that page
being scheduled, while the call returns to the user
process with an "EWOULDBLOCK".

A subsequent attempt to read it gets the paged in data,
and then works as expected.

The poll() call takes note of these outstanding page-in
requests, and uses them to satisfy poll on a readable
condition, so you can e.g. attempt the read, get that it
would block, and then poll on readable on the fd, to
avoid buzz-looping the process.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C72A7B8.DD297F4E>