From owner-freebsd-questions Tue Mar 12 09:47:12 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA01008 for questions-outgoing; Tue, 12 Mar 1996 09:47:12 -0800 (PST) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA00979 for ; Tue, 12 Mar 1996 09:46:26 -0800 (PST) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id SAA20865; Tue, 12 Mar 1996 18:33:15 +0100 From: Luigi Rizzo Message-Id: <199603121733.SAA20865@labinfo.iet.unipi.it> Subject: Re: non-blocking read ? To: leisner@sdsp.mc.xerox.com (Marty Leisner) Date: Tue, 12 Mar 1996 18:33:14 +0100 (MET) Cc: msmith@atrad.adelaide.edu.au, questions@freebsd.org In-Reply-To: <9603121627.AA07775@gnu.mc.xerox.com> from "Marty Leisner" at Mar 12, 96 08:26:44 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Luigi Rizzo stands accused of saying: > > > is there a simple way to issue a non-blocking read to a regular file ? > > > > > > Ideally, I would like a > > > > > > nbread(handle, buf, count); > > > > > > which would start reading from the disk, and could then notify > > > the completion of I/O via select(). > > > > Use async I/O and handle SIGIO like everybody else 8) > > Reads to regular files are non-blocking by default -- you either read > the next block or return EOF...note, they may take "time", but it isn't That's my problem... some programs (noticeably the "harvest" cache) work as a single-threaded process which serves concurrent requests by trying to avoid blocking calls. It appears to do a nice job, but for some things (say reads/seeks etc. from disk) it appears that there is no way to avoid delays -- at least to my knowledge. Thanks Luigi ==================================================================== Luigi Rizzo Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it Universita' di Pisa tel: +39-50-568533 via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 http://www.iet.unipi.it/~luigi/ ====================================================================