Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: Can I/O Completion routine call 'GetRequest'?? Message-ID: <0B010004.nn2ddd@outpost.UUCP> Date: 20 Apr 91 17:27:25 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 39 X-Mailer: uAccess - Mac Release: 1.0.3 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. -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE