Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.sys.amiga,comp.sys.mac Subject: Re: Mac Multitasking? Hee-hee! Message-ID: <2235@cbmvax.UUCP> Date: Wed, 19-Aug-87 13:30:34 EDT Article-I.D.: cbmvax.2235 Posted: Wed Aug 19 13:30:34 1987 Date-Received: Sat, 22-Aug-87 02:22:08 EDT References: <20164@ucbvax.BERKELEY.EDU> Organization: Commodore Technology, West Chester, PA Lines: 63 Xref: mnetor comp.sys.amiga:7559 comp.sys.mac:5722 in article <20164@ucbvax.BERKELEY.EDU>, oster@dewey.soe.berkeley.edu (David Phillip Oster) says: > Amiga fans can help not by explaining why multi-tasking is good, but > by explaining how the Amiga can do multi-tasking without suffering > from the interactive response problems that plague Unix, VMS, and that > plagued the Lisa. That's a fair question. First of all, we're not talking about a multi-tasking system that swaps out stuff to disk. I've personally run into the effect you're talking about on our Apollo systems. The Apollo systems here have typically a megabyte or two of real memory, and they run very large programs. The Amiga in my office, on the other hand, has seven megabytes of real memory, and runs small and medium sized programs, all of which can share run-time libraries. Real memory at this point is nearly as cheap as mass storage, so I'm very unlikely to need swaps out to disk. That takes care of the largest interactive response problem. It's also a single user machine, not multiuser like a UN*X machine. And the OS does a few things based on this that might not be implemented in an OS for multiple users like UN*X or VMS. Task scheduling is based on fixed task priorities. Higher priority tasks always get all the CPU time they need. Whatever is left gets passed down to lower priority tasks. So, providing you run your interactive tasks at a higher priority than your background tasks, everything's cool. Your interactive stuff is always going to run at full speed while you're interacting with it, and your background tasks get all the CPU time that's free when you stop to think about what to type next. If you run multiple interactive tasks, those that you're not interacting with just go to sleep waiting for your attention once again; they take up no time while just waiting for user input. How well this works, of course, somewhat dependent on programmer's using the proper system calls for things. If I have a task that wants to interact with the Intuition system, let's say, the proper thing to do is set up intertask signals, and then Wait() for them, something like Wait(sigregister & SIGBIT). If I instead wrote while (! (sigregister & SIGBIT)); I would certainly waste lots of available CPU time. It sounds like similar clean waiting stuff is being put into the Mac OS; there's no reason it shouldn't be able to benefit from similar things. > The Macintosh has always had event-driven multi-tasking, as opposed to > time-slice. I have written many programs that run as background tasks. > It is just that on the Mac, the interactive application must > explicitly give up control (which it only does at times that are not > critical to the perception of responsiveness.) All the major Macintosh > applications do give up control to background tasks. To see this, run > my "Menu Clock". If the colon between the hour and the minutes display > blinks, then the application is giving up control to the clock. I run my background clock just as any other program, only at a lower priority. Whever it does something, like update it's display or jump to the front of the window stack, it's doing it while my interactive program is waiting on something (usually me or the disk). The responsiveness of the user interface is also based on task priorities; the program I'm interacting with is higher than the clock, and the Intuition and input programs that manage everyone's menus, keyboard, or mouse input are higher than the interactive program, so you don't see the mouse get sluggish or miss keystrokes even when the system starts getting loaded. > --- David Phillip Oster --My Good News: "I'm a perfectionist." -- Dave Haynie Commodore-Amiga Usenet: {ihnp4|caip|rutgers}!cbmvax!daveh "The A2000 Guy" PLINK : D-DAVE H BIX : hazy "I'd rather die while I'm living, than live while I'm dead" -Jimmy Buffett