Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!rex!mandel@vax.anes.tulane.edu From: mandel@vax.anes.tulane.edu (Jeff E Mandel MD MS) Newsgroups: comp.sys.mac.programmer Subject: Re: async write to disk (MPW C) Message-ID: <5917@rex.cs.tulane.edu> Date: 30 Jan 91 15:34:35 GMT References: <1CE00001.a1e4o2@tbomb.ice.com> Sender: news@rex.cs.tulane.edu Organization: Tulane University School of Medicine Lines: 62 In article <1CE00001.a1e4o2@tbomb.ice.com> time@tbomb.ice.com (Tim Endres) writes: > >In article <9341@dog.ee.lbl.gov>, beard@ux5.lbl.gov (Patrick C Beard) writes: >> In article <1016@ra.MsState.Edu> krn1@ra.msstate.edu (Ken Newton) writes: >> #I am working on a real-time application to run on a Mac fx that >> #requires very fast data collection to disk. >> >> The Macintosh OS is an unsuitable OS if you need asynchronous >> access to the hard disk. The SCSI manager can't work asynchronously in >> its current design. Thus you can't take advantage of DMA on the IIfx until >> a later system (later even than system 7). A new disk driver will be required, >> I believe, or a new SCSI manager. > >This is true with one exception. Several manufacturers now sell NuBus >cards that implement SCSI. These are designed in such a way as to >allow asynchronous I/O and dual I/O. I helped write a driver for just >such a card that allowed disk writes to occur while data was being >read from an image card. This worked very well. > >I know MicroNet has such a card, I programmed the Golden Triangle >ASP card, and I think DayStar has a card. > >> However, under A/UX, DMA can and is being used for disk access speedup on >> the IIfx. Ironically Unix is likely to give you better disk performance, >> even though you will probably be spending a lot of time swapping programs >> to and from disk. A/UX has no SCSI manager, just different device drivers. > >Oh so true, however it is straight forward to design A/UX applications >such that they do not swap and are very efficient. Plus I believe >you can access more memory under A/UX than under MacOS currently. > You people are missing the point about real-time programming. Real-time data comes in from outside the Mac, and there will almost always be a way to generate an interrupt when it arrives. Even when the disk manager grabs the CPU for several seconds to copy a big file, interrupts get serviced, and if you are clever, you can continue to sample in real-time. The trick is to control your disk writing so that it is efficient (write a whole disk block) and use the Deferred Task Manager to keep your sampling from blocking the interrupts the Disk Manager needs to complete its work. In any event, DMA will probably not solve your problems unless you are doing something really compute intensive with the acquired data. The bus is blocked during DMA, so you still can't get your data off the board. As far as real-time Unix, good luck. It has been done, but I don't think it is pretty. The bigger issue for all of this is to what extent the Mac is the right platform for embedded control. I have done it; we controlled blood pressure on a number of patients undergoing cardiac surgery with our prototype test bench for closed loop control without mishaps. I lived in terror, however, that someone would decide that they absolutely had to spellcheck their doctoral dissertation or such during a control run. If I ever do something like this again, I will probably get the Serial NB card and do the guts of it in A/ROSE. Flame me if you must, but until you have spent two years trying to make the Mac push the envelope, try to remember your perspective may be limited. Jeff E Mandel MD MS Asst Professor of Anesthesiology Tulane University School of Medicine New Orleans, LA Author of MacInfuse, the most expensive program you will never see.