Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!jade!eris!mwm From: mwm@eris.UUCP Newsgroups: comp.sys.amiga,comp.sys.mac,comp.sys.atari.st Subject: DMA & read-ahead & write-behind (was mac vs. amiga vs. st) Message-ID: <2411@jade.BERKELEY.EDU> Date: Tue, 3-Feb-87 15:52:58 EST Article-I.D.: jade.2411 Posted: Tue Feb 3 15:52:58 1987 Date-Received: Thu, 5-Feb-87 03:30:43 EST References: <8392@watrose.UUCP> <1314@cbmvax.cbmvax.cbm.UUCP> <2174@batcomputer.tn.cornell.edu> Sender: usenet@jade.BERKELEY.EDU Reply-To: mwm@eris.BERKELEY.EDU (Mike (No one lives forever.) Meyer) Organization: Missionaria Phonibalonica Lines: 27 Xref: watmath comp.sys.amiga:1896 comp.sys.mac:1135 comp.sys.atari.st:1266 In article <2174@batcomputer.tn.cornell.edu> braner@batcomputer.UUCP (braner) writes: >As for background reading of the disk: Usually a program NEEDS the data >it requested from the disk drive BEFORE it can do anything else, so >no amount of multi-tasking will speed that program up while it's waiting. >On the other hand, SOME specially-designed programs sometimes read the >disk BEFORE the data is needed, i.e. invite an overlap of reading the >disk and some other processing. On the ST that is possible too, since >the disk I/O is done via the DMA chip, which (as far as I know) CAN take >a command and then execute it independently. It does steal CPU memory >cycles for that, though (or does it? experts, step up?). DMA doesn't steal CPU cycles; it steals bus cycles. The performance impact can run from little or nothing with double-speed, dual-ported memory, to very significant (as in "why bother?") with stock memory and a memory-intensive processor/application pair. Of course, the real win in most applications isn't "read-ahead", but "write-behind." On Unix (and AmigaDOS), a task issues a write, the OS catches & allocates a block on disk, returns ok, then starts the physical I/O. This is a win because the application doesn't have to do it by hand, and the OS can do it more effectively than it can do read-ahead. The same effect can be achieved on a single-tasking system with a write-through cache, but I've seen very few systems do that. Most people just do ram-disk, which has similar performance (for the limited set of things in it), and is much easier to do.