Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Aug 2005 10:58:38 +0200
From:      Maxim Sobolev <sobomax@portaone.com>
To:        Andrey Chernov <ache@freebsd.org>, Dan Nelson <dnelson@allantgroup.com>, "current@freebsd.org" <current@freebsd.org>
Subject:   Re: Sub-optimal libc's read-ahead buffering behaviour
Message-ID:  <20050804085838.GA20122@www.portaone.com>
In-Reply-To: <20050804060830.GB21228@nagual.pp.ru>
References:  <42F0CCD5.9090200@portaone.com> <20050803150117.GD93405@dan.emsphone.com> <42F0E9B2.9080208@portaone.com> <20050804060251.GA21228@nagual.pp.ru> <20050804060830.GB21228@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050804085838.GA20122>