Re: LBAcache devel BUGFIX and improved release

"Arkady V.Belousov" <[email protected]> Mon, 11 Nov 2002 20:03:29 +0300 (MSK)
Newsgroups gmane.os.freedos.devel,gmane.spam.detected
Message-ID <[email protected]>
X-Comment-To: Eric Auer

Hi!

11-=EE=CF=D1-2002 15:52 [email protected] (Eric Auer) wrote to [email protected]=
:

EA> Hi, are you sure this is a priority queue type problem?

     Yes. You should find/select some entry by some criteria (priority) and=

exclude it. If entries will be ordered by priority, then you will simply
remove entry from one end of sequence (and this is definition of queue).

EA> - if you are almost out of DOS memory, the .com version will not notice=

EA>   and you will get in troubles when you spend more than you have

     You may workaround this if will check stack top (SP value): stack
placed after program at the end of segment (0FFFEh if there is enough
memory), so you should substract from SP end of code/data address and you
will know how much memory you have.

     But .EXE allows to omit such efforts, so for CTMOUSE I select this.

EA> - I remember that "use least used if have to discard one" is no good:

     There are many different strategies. Again: take a look in Knuth book,=

there studied and analyzed many different implementations and algorithms
(which given as verabl definition and code in formal MIX assembler).

EA> By the way, my hashing is just "sector number xor (drive shift ...)" an=
d
EA> then modulo sector size. I do not see why a simple modulo should not be=

EA> okay for my simple needs. But who knows?

     Sector size is a 512 (2^9) value, so this is not the best - this modul=
o
simply gets 9 lower bits. Again: Knuth studies different hash functions, so=

you may/should study his work if you wish to make better/best algorithms.