[lkml]   [1998]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Non-blocking I/O

-----Original Message-----
From: Richard Gooch <Richard.Gooch@atnf.CSIRO.AU>
To: Chris Wedgwood <>
Cc: Alan Cox <>; <>; <>
Date: Tuesday, July 21, 1998 5:17 AM
Subject: Re: Non-blocking I/O

>> O_NONBLOCK is meaningless for read/write because its not clear what
>> happen and how you would make the code work in practice. I think
>> for read/write is asking fro trouble, unless I can think of a sane
>SAPI for
>> it.
>How's that? We have non-blocking I/O for reading and writing right now
>for ttys, pipes and sockets. The interface is simple and well
>understood. How is extending that to regular files a conceptual

Should be very easy indeed, just check for O_NONBLOCK when you are going to block a process waiting for disk I/O, and return the number of bytes read so far. Of course, all I/Os that you return EWOULDBLOCK on need to be scheduled so that at some point in the future they won't block. If the buffer cache locks in pages with pending transfer to userspace, I suppose it would also be wise to check for misbehaving processes chewing up a whole bunch of buffer cache with nonblocking I/O requests that they never service with some kind of timeout mechanism on the locks.

Zachary Amsden

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:43    [W:0.088 / U:6.036 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site