Re: Sub-optimal libc's read-ahead buffering behaviour

From: Maxim Sobolev <sobomax_at_portaone.com>
Date: Thu, 4 Aug 2005 10:58:38 +0200
On Thu, Aug 04, 2005 at 10:08:30AM +0400, Andrey Chernov wrote:
> On Thu, Aug 04, 2005 at 10:02:51AM +0400, Andrey Chernov wrote:
> > No surprize. Single read can be consider as sort of "atomic" operation.
> > But between read & seek character device itself can move its pointer in 
> > anyplace.
> 
> No only move the pinter, but change contents too. Consider reading 
> /dev/mem

Actually this is good example which supports my point, since with the
current behaviour when doing 2 subsequent reads each of them less than
4K in size you will get either outdated data from the second read or
even worse - mix of the old data and the new data when second read crosses
buffer boundary!

I think that any buffering should be disabled for reading from chardev
no matter how "historic" our current behaviour is.

-Maxim
Received on Thu Aug 04 2005 - 06:58:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:40 UTC