Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!mondo.engin.umich.edu!davids From: davids@mondo.engin.umich.edu (David Snearline) Subject: Re: Can I/O Completion routine call 'GetRequest'?? Message-ID: <1991Apr21.224503.12761@engin.umich.edu> Sender: news@engin.umich.edu (CAEN Netnews) Organization: Computer Aided Engineering Network (CAEN), University of Michigan References: <0B010004.nn2ddd@outpost.UUCP> Distribution: na Date: Sun, 21 Apr 1991 22:45:03 GMT In article <0B010004.nn2ddd@outpost.UUCP> peirce@outpost.UUCP writes: > >In article <63618@bbn.BBN.COM>, rmitchel@bbn.com (Rob Mitchell) writes: >> >> >> I've created a list of 20 parameter blocks and queued them into a >> pseudo "free" list (at the start of my program). Each has a "state" >> of FREE. I call ATP's 'GetRequest' asynchronously once using a globally >> created param block (should it really be a global or one of the "free" >> ones?). >> >> When Mac receives a TReq, my I/O Completion routine assigns reg. A0 >> (which contains address of current param block) to local variable and >> set param's "state" to INCOMING. >> >> What I need to do now is queue another 'GetRequest' from my I/O >> Completion routine. Can I call I use a different "free" element >> and make the 'GetRequest' call from my I/O Completion routine? >> I'm not allocating/moving any memory, right? GetRequest should >> just assign a bunch of pointers, right? It probably doesn't move >> or allocate any memory, right?? >> >> How else can I have at least one 'GetRequest' always outstanding >> at *any* given time????? >> >> Thanks in advance!!!! > >Sounds like you have the right idea. Calling PGetRequest from a completion >routine is fine and a common approach found in many programs. And >it's the only way to implement programs that live only at interrupt >level. Just be doubly sure that that your parameter blocks are really >free when you reuse them! > >Good luck with your project. Is it possible to re-use the same parameter block from your completion routine? ie. Has IODone already called Dequeue on your parameter block by the time it calls your completion routine? Thanks in advance. -- David Snearline University of Michigan Engineering davids@mondo.engin.umich.edu