Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: Background MAGIC (and I don't mean multifinder!!) Summary: Install device driver and use "needs periodic service" Message-ID: <7083@umd5.umd.edu> Date: 10 Aug 90 17:58:21 GMT References: <1990Aug9.203803.13885@ecn.purdue.edu> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 27 In article <1990Aug9.203803.13885@ecn.purdue.edu> moyman@ecn.purdue.edu (James M Moya) writes: > How is it that cdev/INIT's like Moire and SuperClock (and many others) can > run in the background whether multifinder is running or not!! Other followups to this message have mentioned Vertical Retrace interrupts and patching traps, but there are two other solutions that might be useful in some specific instances. One possibility is to install a device driver at init time and use the "needs periodic service" bit to get the driver called periodically as a result of the user program calling SystemTask. Another possibility is to use IO completion chaining, in which the completion routine for one IO operation does an ASYNCHRONOUS call to schedule IO for the next IO operation. For example, a simple AppleTalk responder could daisy chain between a lurking read for a probe and a response to the probe. Can you say "responder"? This works well when the parameter blocks can be preallocated and mostly loaded and only a little information has to be patched in on the fly. -- Ben Cranston A determined iconoclast, it would be better to assume the opinion expressed above is the diametric OPPOSITE to that of the Warm and Fuzzy Network Group of Egregious State University...