Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!elroy!cit-vax!mangler From: mangler@cit-vax.Caltech.Edu (Don Speck) Newsgroups: comp.unix.wizards Subject: Re: Shared Memory in BSD4.3 is lacking? Message-ID: <5847@cit-vax.Caltech.Edu> Date: 20 Mar 88 08:50:17 GMT References: <12136@brl-adm.ARPA> Organization: California Institute of Technology Lines: 22 Summary: select on disk files should read-ahead In article <12136@brl-adm.ARPA>, rbj@icst-cmr.arpa (Root Boy Jim) writes: > I tend to think of using > select on tty's or sockets (pipes), but do they work on regular files > as well? What if the file pointer is at EOF? And then what if someone > appends to the file? What about tape drives? On disk and tape, select() returns success immediately. What ought to happen instead is that select() on a disk file should pause until the buffer cache contains the block that would be needed to satisfy a read at the current file pointer. This may involve queuing a block I/O request, or just waiting for a read-ahead to finish. Making this work properly at EOF would certainly make "tail -f" more efficient! In the same vein, select() on a raw disk would initiate a seek, allowing a certain amount of asynchronous I/O. Similarly, select() on a tape drive ought to pause until the tape is positioned for I/O and not moving (and certainly not rewinding). Don Speck speck@vlsi.caltech.edu {amdahl,ames!elroy}!cit-vax!speck