Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!cs.ed.ac.uk!cs.edinburgh.ac.uk!nick From: nick@cs.edinburgh.ac.uk (Nick Rothwell) Newsgroups: comp.sys.mac.programmer Subject: Re: doing real work at interrupts Keywords: driver Message-ID: <1185@skye.cs.ed.ac.uk> Date: 31 Oct 90 14:29:39 GMT References: <1990Oct30.152816.2172@cs.umu.se> <2303@heavens-gate.lucid.com> <1990Oct30.131140.10113@hellgate.utah.edu> Sender: nnews@cs.ed.ac.uk Reply-To: nick@lfcs.ed.ac.uk Organization: Wavetables 'R' Us Lines: 23 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 > > apple, but the right thing to have is a call that effectively says "call > > this function with these arguments at the next possible opportunity." > > How about opening a "device driver" that doesn't actually do any > reading or writing to a device, but has its "dNeedTime" flag set, Why bother? Just declare a static circular buffer, have the interrupt routine place messages into it in some format, and have the main application examine it somewhere in the event loop. I did this for error messages from the MIDI Manager. It's about 1/2 hour's work, and works fine. -- Nick Rothwell, Laboratory for Foundations of Computer Science, Edinburgh. nick@lfcs.ed.ac.uk !mcsun!ukc!lfcs!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ "Now remember - and this is most important - you must think in Russian."