Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: DA loses resource file on accRun Keywords: MultiFinder DAs context switches Message-ID: <33359@apple.Apple.COM> Date: 21 Jul 89 18:34:34 GMT References: <1989Jul17.045641.20314@lth.se> <2932@internal.Apple.COM> <14573@dartvax.Dartmouth.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 34 In article <14573@dartvax.Dartmouth.EDU> matthews@eleazar.dartmouth.edu (Jim Matthews) writes: >In article <2932@internal.Apple.COM> goldman@apple.com (Phil Goldman) writes: >> The resource file was originally opened when the DA >>Handler was running. However, at accRun time some other app may be >>running, and that app has a different resource chain than DA Handler, so >>when the resource manager searches the current chain it never does find >>your map. > >This is one more way in which MultiFinder makes DAs second class >citizens. A more dramatic example of the problem can be seen by having >a DA open a window at accRun time -- it will appear in the foreground >app's layer, not (necessarily) the DA Handler's. > >So, how hard would it be to make MultiFinder treat background DAs the >way it treats background apps -- i.e. do a minor switch to DA Handler >before issuing the accRun call? Not hard at all. However, as I understand it, there was a very conscious decision to not make that switch. Doing so would have to be done *VERY* frequently, and - put in technical terms - this slowed down the Mac a bunch. Background applications get the minor switch because they can be optimized for background time. First of all, background applications don't get null events unless the canBackground bit is set. Second, there is the 'sleep' parameter of WaitNextEvent. Both of these help prevent numerous minor switches. DA's don't have these options available to them, so saving time had to be done in this other way. ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions