Deferred Task Manager

The Deferred Task manager on the macintosh gives you a way to delay some of your interupt processing until a less time critcal point. If you do something lengthy in your interupt routine, you'll mask other interupts from occuring. The Deferred Task manager allows you to specify a routine that should run after all other interupts have finished processing. This will allow the machine to function better, but still get you some time to process before normal applications get the CPU. Your task will still run at "interupt time" so no memory moving, etc... you have a really low priority so you wont mask other interupts.

Fine and great, the problem is that you dont have your own A5 inside this task. The parameter block passed does have space for a parameter, but you need asm to get at it. In addition you need to get the memory for the deferred task parameter block from somewhere, and you cant allocate it inside the interupt vector your making the call from. My interface here preallocates a block of paramater records, and arranges to restore the current A5 when your task is called. This saves you from thinking about exactly whats going on, and writing evil assembly. Of course you'll have to make sure that you application A5 is valid when you make the call, so that I restore something reasonable.

DT_InstallDeferredTask() - Install the task

Source and example for Mac (binhex) - /u/jedavis/src/lib/libmac/Examples/DeferredTask.sit.hqx
Possibly newer versions of DeferredTask.cp and DeferredTask.h - /u/jedavis/src/lib/libmac

James Davis -