Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!dartvax!chocorua!kurash From: kurash@chocorua (Mark Valence) Newsgroups: comp.sys.mac.programmer Subject: Re: Can I/O Completion routine call 'GetRequest'?? Summary: ATP works a bit differently Keywords: ATP GetRequest IOCompletion Dequeue Message-ID: <1991Apr22.180211.19261@dartvax.dartmouth.edu> Date: 22 Apr 91 18:02:11 GMT References: <0B010004.nn2ddd@outpost.UUCP> <1991Apr21.224503.12761@engin.umich.edu> Sender: kurash@dartmouth.edu Followup-To: kurash@dartmouth.edu Distribution: na Organization: Dartmouth College, Hanover, NH Lines: 42 >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? > The quick answer: Yes, it's OK. The longer answer: In general, the fact that the call is completing means that the parameter block is NOT on the queue. The IODone removes queued calls from a driver's queue and THEN the driver is handed the parameter block (queue element, pb). The only way a param block gets queued in the first place is if you make the call asynchronously, AND, when the call is made, the driver is busy with another call. When that call completes, it calls IODone, which dequeues the (async) block, and calls the driver with that block. In ATP, details are a bit different. ATP almost never calls IODone - it handles its driver queue all by itself, placing the parameter block on one of many internal queues (yes, plural). Because it doesn't use IODone, ATP also handles calling your IOCompletion routine. First, it removes your pb from whichever internal queue it is on, and then it calls your completion routine. Well, that's a very sketchy description, but hopefully it answers the question. If you want more details, e-mail. I don't know anyone at Apple, so this is certainly not official word, just the musings of a hacker. >Thanks in advance. > Your welcome in arrears. >-- >David Snearline >University of Michigan Engineering >davids@mondo.engin.umich.edu Mark.