Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Interrupt level tasks Message-ID: <8169@hoptoad.uucp> Date: 30 Jul 89 01:01:14 GMT References: <6081@hubcap.clemson.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 40 In article <6081@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >Is there anyway to perform tasks that get move memory at the interrupt >level? For instance, i need to change some TE records, bring up a >dialog box, draw some text, etc. All of which move memory. Theoretically, yes, but not in practice. Don't do it.... >The reason i NEED to do it at interrupt level is that the information is >coming in over appletalk via asynch calls and if i don't process it right >away, it may get lost. I could buffer it to memory, but then i'd have to >create nodes in something like a linked list and this moves memory also. No, you just pre-allocate your buffer storage (at the synchronous level, before starting) and use that. You don't even need to do your own locking of interrupts if you use the Enqueue and Dequeue traps to manipulate the linked lists. Then at the synchronous level, you pull entries off the incoming request queue and process them. After they're processed, put them back onto the free queue. You will also have to put in some sort of flow control mechanism if it's important that the data not be lost. If you are using ATP, for instance, don't issue a GetRequest unless there is enough buffer storage to handle it. When you do your synchronous processing, you should note if you are running out of storage, and if so, try to allocate some more. >I thought of buffering to disk cause file manager calls don't move memory, >but i could end up getting interrupted so often that the buffer file >becomes extremely large and causes other sorts of problems. It's possible to put your request queu out to disk, but it would wind up impacting system performance. If you do flow control, this should not be necessary. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "The above opinions and suggestions have absolutely nothing to do with the little, fat man putting crisp, $100 bills in my pocket." -- Alan Vymetalik