Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zazen!schaefer.math.wisc.edu!dickie From: dickie@schaefer.math.wisc.edu (Garth Dickie) Newsgroups: comp.sys.mac.programmer Subject: Re: Questions about multitasking on the mac Message-ID: <1991May12.194909.18585@schaefer.math.wisc.edu> Date: 12 May 91 19:49:09 GMT References: <1991May11.191114.27564@potomac.ads.com> Reply-To: dickie@math.wisc.edu (Garth Dickie) Organization: Univ. of Wisconsin Dept. of Mathematics Lines: 26 In article <1991May11.191114.27564@potomac.ads.com> jtn@potomac.ads.com (John T. Nelson) writes: > >I suppose this can be done but its GROSS infusing this event code in >every module to get timely event updates. I can't figure out a better >way unfortunately. Anyone have a different philosophy on how this >could be accomplished? > As has been mentioned, you can avoid losing too much time, by counting how long it has been since a WaitNextEvent. This still means changes throughout your code. The inner event call has to be fairly restictive to the user, and you still need to handle update events, etc. When you want to improve the user interaction later, you are still stuck with a redesign. This gives you some minimal backgrounding ability, but doesn't buy you much else. To really move to a single event loop, you probably have to find a way to modularize your code. I have tried this in some projects, and it definitely simplifies the user's view of the program. It can enforce some orthoganality that might otherwise be abandoned. Of course, when I did this there was not as much state to preserve across computations as a compiler would need. It appears that in general, this is a hard problem :-( Of course, MPW tools seem to solve it, but I think they use the first model, calling out to a timeslicer. Anybody who's designed an MPW compiler tool care to comment? -- Garth Dickie -- Confused Math Graduate Student -- dickie@math.wisc.edu