🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #15722

Re: B-Trees and TurboPascal...HELP MEEEEE!!!!

#15722
From: Joachim Pimiskern
Date: Mon, 28 Aug 2000 00:00
28 lines
2147 bytes
Hi Fabio,

Fabio schrieb:
> I have to write a program in Turbo Pascal using the B-Tree technique.
> the fact is that i don't know how to handle secondary memory,
> which is the particularity of those B-Tree

you need a virtual memory system. At present you hold all pages
in RAM, and the pages contain pointers to other pages.

The next step is to hold all pages on disk, for example
in a "file of TPage". Each page pointer that now points
to a place in the core memory must be replaced by a page
number and an offset to a place within the page. 
Longint could contain the page number in the hiword and
the offset in the loword. 

For purposes of efficiency you should implement
a buffered page allocation system. That means, you hold
a couple (for instance, 10) pages in RAM, and if one
page has to be accessed that doesn't reside in the buffer,
you must replace one page. Choose a page (for example the
least recently used , LRU), and flush the content,
if the page has been altered since it was loaded into the RAM.
Now overwrite the page by the desired one.

Greetings,
Joachim
Technical Details
Message-ID: <39AA1100.8F40BAA8@de.bosch.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8o8rru$f0o$1@nslave2.tin.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 102b1d,d98d277cbd3b1e67
X-Google-Attributes: gid102b1d,public
X-Google-Thread: fcea4,d98d277cbd3b1e67
X-Google-Attributes: gidfcea4,public
X-Google-Thread: ff121,d98d277cbd3b1e67
X-Google-Attributes: gidff121,public
X-Google-Thread: 108955,d98d277cbd3b1e67
X-Google-Attributes: gid108955,public
From: Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
Subject: Re: B-Trees and TurboPascal...HELP MEEEEE!!!!
Date: 2000/08/28
Message-ID: <39AA1100.8F40BAA8@de.bosch.com>
X-Deja-AN: 663375169
Content-Transfer-Encoding: 7bit
References: <8o8rru$f0o$1@nslave2.tin.it>
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@internet.bosch.de
X-Trace: proxy.fe.internet.bosch.de 967446805 20997 128.1.22.226 (28 Aug 2000 07:13:25 GMT)
Organization: Robert Bosch GmbH
Mime-Version: 1.0
NNTP-Posting-Date: 28 Aug 2000 07:13:25 GMT
Newsgroups: be.comp.programming,comp.software.extreme-programming,de.comp.datenbanken.misc,de.comp.datenbanken.ms-access