Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!portal!atari!imagen!sun!prisoner.Eng.Sun.COM!zellers From: zellers@prisoner.Eng.Sun.COM (Steve Zellers) Newsgroups: comp.sys.mac.programmer Subject: Re: Handles (was Re: HLock interdiction??) Keywords: MacTutor, Memory Manager, DogCow Message-ID: <142885@sun.Eng.Sun.COM> Date: 22 Sep 90 00:24:37 GMT References: <1990Sep21.043054.24649@cunixf.cc.columbia.edu> <16451@unix.SRI.COM> <10360@goofy.Apple.COM> Sender: news@sun.Eng.Sun.COM Organization: Bewilder-Beast, LTD. Lines: 22 In article <10360@goofy.Apple.COM> rcm@Apple.COM (Robert Monsen) writes: >Do it with all your handles. If you call a routine, it shouldn't have to >know whether the caller has locked it. This can be the source of >quite subtle bugs. This isn't quite as bad as clearing 0.l so that your code doesn't crash when you derefence nil, but it's almost as bad... Do things because you understand them, not because you've been burned by them. IM would let you know if a handle will be locked/unlocked/disposed of by a routine. Don't do it unless you have to. In your own code, pay attention to who may lock a handle, and write your routines in a manner to reduce handle locking. They don't cost that much now, but who knows what will happen in the future? I'd much rather have fast, well written software, than slow, well written software... -- ------------------------------------------------------------------------ Steve Zellers zellers@prisoner.sun.com "And she wonders if the lizard likes its lettuce rare." -- The Residents