Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!uniwa!vax7!nlewispn From: Lewis_P@cc.curtin.edu.au (Peter Lewis) Newsgroups: comp.sys.mac.programmer Subject: Re: doing real work at interrupts Message-ID: <4249.272ea016@cc.curtin.edu.au> Date: 31 Oct 90 01:57:42 GMT References: <1990Oct30.152816.2172@cs.umu.se> <2303@heavens-gate.lucid.com> <1990Oct30.131140.10113@hellgate.utah.edu> Organization: Curtin University of Technology Lines: 54 In article <1990Oct30.131140.10113@hellgate.utah.edu>, u-lchoqu%peruvian.utah.edu@cs.utah.edu (Lee Choquette) writes: > In article <2303@heavens-gate.lucid.com> pab@lucid.com (Peter Benson) writes: >> >> It seems like what is needed is a general mechanism whereby any sort of >> task can be initiated at interrupt level. This would have to be done by > > How about opening a "device driver" that doesn't actually do any > reading or writing to a device, but has its "dNeedTime" flag set, > indicating the system should call its control routine at specific > intervals--or as often as possible if the drvrDelay word is zero. The > system doesn't actually call the control routine until the application > calls SystemTask, but at that time you can go ahead and do all the > memory movement you want. I believe you can even do drawing and > window management. > > The main disadvantage to this scheme is that such drivers won't get > called when the application is not calling SystemTask or WaitNextEvent, If you don't mind waiting until SystemTask is called, you could patch SystemTask at the same time as you install your interupt handler. Then you could have the interupt handler set a variable (PC relative) to true when the interupt occurs, and have your SystemTask patch test this and do the interupt handling if it is true, and then call SystemTask. Pseudo Code - NewSystemTask: TEST an_interupt_occured JSR NE Handle_Interupt JMP (original_SystemTask) an_interupt_occured: DC.W 0 InterupHandler: SET an_interupt_occured RTS (I assume SystemTask can move memory, I don't have IM handy.) I don't know if its any better/worse to install a patch or a device driver, but its probably easier to install a patch. I really home Apple's Thought Police haven't been listening in to this discusion! Happy Hacking, Peter. PS: The UMPG looks really good! Anyone who wants to post a question should look there first (it answered my last posted question) -- Disclaimer:Curtin & I have an agreement:Neither of us listen to either of us. *-------+---------+---------+---------+---------+---------+---------+-------* Internet: Lewis_P@cc.curtin.edu.au I Peter Lewis ACSnet: Lewis_P@cc.cut.oz.au I NCRPDA, Curtin University Bitnet: Lewis_P%cc.curtin.edu.au@cunyvm.bitnet I GPO Box U1987 UUCP: uunet!munnari.oz!cc.curtin.edu.au!Lewis_P I Perth, WA, 6001, AUSTRALIA "!thgir s'ti naem t'nseod yaw taht ti seod enoyreve esuaceb tsuJ"