public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* O_NONBLOCK on files
@ 2001-09-19  6:46 Simon Kirby
  2001-09-19  7:05 ` Eric W. Biederman
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kirby @ 2001-09-19  6:46 UTC (permalink / raw)
  To: linux-kernel

I've always wondered why it's not possible to do this:

fd = open("an_actual_file",O_RDONLY);
fcntl(fd,F_SETFL,O_NONBLOCK);
r = read(fd,buf,4096);

And actually have read return -1 and errno == EWOULDBLOCK/EAGAIN if the
block requested is not already cached.

Wouldn't this be the ideal interface for daemons of all types that want
to stay single-threaded and still offer useful performance when the
working set doesn't fit in cache?  It works with sockets, so why not
with files?

I see even TUX has to have I/O worker threads to work around this
limitation, which seems a bit silly.

Simon-

[  Stormix Technologies Inc.  ][  NetNation Communications Inc. ]
[       sim@stormix.com       ][       sim@netnation.com        ]
[ Opinions expressed are not necessarily those of my employers. ]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-09-24 21:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-19  6:46 O_NONBLOCK on files Simon Kirby
2001-09-19  7:05 ` Eric W. Biederman
2001-09-19  7:24   ` Simon Kirby
2001-09-24 20:47     ` Matti Aarnio
2001-09-24 21:05       ` Simon Kirby
2001-09-24 21:30         ` Benjamin LaHaise
2001-09-19  8:52   ` Erik Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox