Path: utzoo!attcan!uunet!cs.utexas.edu!wasatch!mailrus!tut.cis.ohio-state.edu!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!matthews From: matthews@eleazar.dartmouth.edu (Jim Matthews) Newsgroups: comp.sys.mac.programmer Subject: Re: DA loses resource file on accRun Keywords: MultiFinder DAs context switches Message-ID: <14600@dartvax.Dartmouth.EDU> Date: 23 Jul 89 01:25:20 GMT References: <1989Jul17.045641.20314@lth.se> <2932@internal.Apple.COM> <14573@dartvax.Dartmouth.EDU> <33359@apple.Apple.COM> Sender: news@dartvax.Dartmouth.EDU Reply-To: matthews@eleazar.dartmouth.edu (Jim Matthews) Organization: Dartmouth College, Hanover, NH Lines: 29 In article <33359@apple.Apple.COM> Keith Rollin writes: >In article <14573@dartvax.Dartmouth.EDU> Jim Matthews writes: >>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? > >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. I can believe that the minor switch would be time consuming, but it isn't true that DAs have no way to control their use of background time -- that's what the dCtlDelay field is for. I suppose what I'd like most is to have these decisions documented. The programming model for DAs under MultiFinder may be well thought out, but it isn't very clear. For example: if a DA under MultiFinder calls ModalDialog, background apps will continue to get time (since ModalDialog calls either GetNextEvent or WaitNextEvent). But DAs and drivers with dNeedTime lit will not get their periodic time. We have network protocol drivers that time out when a DA calls Std File, but *not* when an app does the same thing. There may be a reason for this (avoiding re-entrancy is a likely candidate) but I've never seen it documented, much less justified. Jim Matthews Dartmouth Software Development