Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!bu.edu!dartvax!quimby!kurash From: kurash@quimby.dartmouth.edu (Mark Valence) Newsgroups: comp.sys.mac.programmer Subject: Re: doing real work at interrupt Summary: Notification Message-ID: <25483@dartvax.Dartmouth.EDU> Date: 1 Nov 90 17:42:15 GMT References: <1990Oct30.152816.2172@cs.umu.se> <2303@heavens-gate.lucid.com> Sender: news@dartvax.Dartmouth.EDU Reply-To: kurash@quimby (Mark Valence) Organization: Dartmouth College Lines: 22 I think what you are looking for is the Notification Manager. The routines _NMInstall and _NMRemove are both accessible during interrupt time, so your interrupt can place a (pre-allocated) NMRec onto the notification queue. One of the fields of this record is nmCompletion, which is a ProcPtr to a procedure to run. This proc is executed during SystemTask, so it can allocate more memory, dispose stuff, draw to the screen, POST A MESSAGE, oooh, lot's of good stuff. See Tech Note #184. About using NewPtr, NewHandle, DisposXxx during interrupts: Why don't you just allocate a bunch of memory at INIT time (when you install your interrupt routine), and do your own memory management? I mean, it doesn't buy you anything tos use handles in this circumstance, and pointers are not very hard to implement (I mean the pointer routines aren't hard). This way, you could even optimize your allocation/deallocation routines to suit your exact purposes (maybe ever block is the same size, maybe allocated blocks are deallocated in FIFO order, etc.) Mark.