Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #3665

Re: DPANS94 BLOCK/BUFFER ambiguity?

Date 2011-06-30 12:46 +0100
From Mark Wills <markrobertwills@yahoo.co.uk>
Newsgroups comp.lang.forth
Subject Re: DPANS94 BLOCK/BUFFER ambiguity?
References <121cc3fd-5605-4c3e-b145-364058b0a886@d19g2000prh.googlegroups.com>
Message-ID <TdCdnSrTI_qU_5HTnZ2dnUVZ7v2dnZ2d@bt.com> (permalink)

Show all headers | View raw


On 28/06/2011 22:19, Jean-François Michaud wrote:
> Interestingly, and quoted from DPANS94, and taken from both the BLOCK/
> BUFFER definition, "If block u is already in a block buffer, a-addr is
> the address of that block buffer." cannot be strictly determined
> without doing a comparion between the content of the buffer and the
> mass-storage content for the associated block number which implies a
> systematic mass-storage read or a mirror image of mass-storage being
> present and maintained in memory for such a comparison to take place.
> So we can generally extrapolate that the standard doesn't intend for a
> very heavy implementation and is thus implicitly giving precedence to
> BUFFER over BLOCK while assuming speed over accuracy.

A comparison is not required. When BLOCK is called to retrieve a block 
from disk, an internal table of some sort is consulted to determine if 
the block is already in memory. If it is, the address of the beginning 
of the block is returned.

In addition, a mechanism is provided to indicate if the contents of the 
block have been changed in memory, meaning the version on disk is now 
out of date. In my implementation, I call updated block buffers "dirty". 
UPDATE will utilise this mechanism to set the last accessed block's 
status to dirty. FLUSH will also use this information to determine which 
blocks to flush to disk when no more buffers are available.

Regards

Mark

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

DPANS94 BLOCK/BUFFER ambiguity? Jean-François Michaud <cometaj@comcast.net> - 2011-06-28 14:19 -0700
  Re: DPANS94 BLOCK/BUFFER ambiguity? Elizabeth D Rather <erather@forth.com> - 2011-06-28 14:06 -1000
  Re: DPANS94 BLOCK/BUFFER ambiguity? Mark Wills <markrobertwills@yahoo.co.uk> - 2011-06-30 12:46 +0100
    Re: DPANS94 BLOCK/BUFFER ambiguity? Jean-François Michaud <cometaj@comcast.net> - 2011-07-03 09:38 -0700
      Re: DPANS94 BLOCK/BUFFER ambiguity? Elizabeth D Rather <erather@forth.com> - 2011-07-03 08:44 -1000

csiph-web