From owner-freebsd-hackers Tue Feb 19 11:30:26 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hawk.mail.pas.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id AFD6537B419 for ; Tue, 19 Feb 2002 11:30:21 -0800 (PST) Received: from pool0641.cvx21-bradley.dialup.earthlink.net ([209.179.194.131] helo=mindspring.com) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16dFxq-00077c-00; Tue, 19 Feb 2002 11:30:11 -0800 Message-ID: <3C72A7B8.DD297F4E@mindspring.com> Date: Tue, 19 Feb 2002 11:30:00 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Alfred Perlstein Cc: Dominic Marks , Kip Macy , Peter Wemm , Mike Silbersack , Hiten Pandya , freebsd-hackers@FreeBSD.ORG Subject: Re: In-Kernel HTTP Server (name preference) References: <20020219092058.A78717@host213-123-131-110.in-addr.bto> <20020219175431.A12535@host213-123-131-110.in-addr.bto> <20020219180004.GO12136@elvis.mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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