Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpcea!hpfcdc!stroyan From: stroyan@hpfcdc.HP.COM (Mike Stroyan) Newsgroups: comp.sys.amiga Subject: Re: AmigaDos don't thrash no more! Message-ID: <5500013@hpfcdc.HP.COM> Date: 17 Feb 88 00:49:28 GMT References: <8504@sunybcs.UUCP> Organization: HP Ft. Collins, Co. Lines: 24 >>AmigaDos should sort disk requests by track. This way if three processes >>ask for three different files scattered all over the disk, instead of >>jumping around like a Tasmianian Devil getting blocks from first one >>file, then the other then back to the first, AmigaDos would load in the >>blocks on the tracks currently nearest the read head. > >Unfortunately, this scheme could cause starvation ( ie. a certain read >request doesn't get serviced because it's on the opposite end of the >disk ) not to mention problems with syncronizing reads and writes if you >start using a selection order other than first-come-first-serve. An elevator algorithm doesn't produce starvation. First the head sweeps to the right, servicing the closest request in that direction. When there are no more requests to the right, the head sweeps to the left, servicing the closest requests in that direction until it again runs out of requests. There are no problems with synchronizing reads and writes as long as requests on the same track and block are performed in a first-come-first-serve order. Of course if one process is making synchronous read and write requests all over the disk, then only disk cacheing can save you. Mike Stroyan, [hplabs!]hpfcla!stroyan