Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Safety of using async _Control from ioCompletion? Message-ID: <10614@hoptoad.uucp> Date: 6 Mar 90 00:04:48 GMT References: <1990Mar5.031521.4774@caen.engin.umich.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 21 In article <1990Mar5.031521.4774@caen.engin.umich.edu> mystone@mondo.engin.umich.edu (Dean Yu) writes: > I know the old litany of not moving memory from a completion routine. What >I'm wondering is if it's safe to make an asynchronous _Control call from a >completion routine. I was thinking about the AppleTalk drivers specifically; >if I have all the response and request buffers allocated beforehand, is it >safe to send an async SendResponse in the completion routine of a GetRequest? Sure, but just to be safe, use a different parameter block. And at all costs avoid the situation where you set up a possibly bottomless recursion, where the completion routine for operation A starts operation B and the completion routine for operation B starts operation A. You wouldn't think these things would complete immediately and overflow the stack, and they usually don't, but I have seen some cases where they do. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "I see little divinity about them or you. You talk to me of Christianity when you are in the act of hanging your enemies. Was there ever such blasphemous nonsense!" - Shaw, "The Devil's Disciple"