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 [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message