Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!pacbell!barn!everexn!drew From: drew@everexn.com (Drew Rogge) Newsgroups: comp.sys.mac.system Subject: Re: True Multitasking Message-ID: <1991Jan18.195343.6636@everexn.com> Date: 18 Jan 91 19:53:43 GMT References: <1991Jan15.233452.1163@maverick.ksu.ksu.edu> <42602@ut-emx.uucp> <11745@goofy.Apple.COM> Organization: Everex Systems, Sebastopol Lines: 30 In article <11745@goofy.Apple.COM> lsr@Apple.com (Larry Rosenstein) writes: >MPW tools (including the compiler) run nicely in the background. In fact, >it is very easy to take some generic C utility and make it run in the >background under MPW. Does anyone know if there is a function that an MPW tool can call which will yield control of the CPU for a while to give other tasks a chance to run? I ported Dave Buck's raytracer, DKBTrace, to run as an MPW tool but the response time of the system was horrible when it was running. The program is very compute bound and doesn't call out to the system very often. On the issue of preemptive vs. cooperative multitasking, it seems to me that only the OS really knows what's going on in the entire system. I imagine that there's a lot of time wasted by tasks interrupting their operation just to give the operating system a chance to check if there's anything else to do. One thing to remember is that preemptive multitasking does not necessarily mean that every task gets allotted equal slices of time in a round-robin fashion. There are many methods for tasks which don't have anything to do to cause themselves to be temporarily removed from the scheduling queue. It is also possible for "foreground" task(s) to be allocated a larger percentage of the system resources. I could be wrong, but I think that one problem with implementing preemptive multitasking on a Mac are sections of "critical" code in applications which occur when the low memory globals are being accessed or modified. Drew Rogge drew@everexn.COM