Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!husc6!husc4!hadeishi From: hadeishi@husc4.UUCP Newsgroups: comp.sys.amiga,comp.sys.mac,comp.sys.m68k,comp.sys.misc Subject: Re: Re: Mac vs. Amiga Message-ID: <1105@husc6.UUCP> Date: Tue, 27-Jan-87 01:08:28 EST Article-I.D.: husc6.1105 Posted: Tue Jan 27 01:08:28 1987 Date-Received: Tue, 27-Jan-87 19:34:57 EST References: <8520@topaz.RUTGERS.EDU> <1270@cbmvax.cbmvax.cbm.UUCP> <5240@ism780c.UUCP> <2312@jade.BERKELEY.EDU> <5283@ism780c.UUCP> Sender: news@husc6.UUCP Reply-To: hadeishi@husc4.UUCP (mitsuharu hadeishi) Organization: Harvard Science Center Lines: 90 Summary: Servant, Switcher, and Amiga context switching Xref: watmath comp.sys.amiga:1710 comp.sys.mac:956 comp.sys.m68k:172 comp.sys.misc:255 Sorry to carry on this Mac vs. Amiga comparison, but it can sometimes be instructive. In <5283@ism780c.UUCP> tim@ism780c.UUCP (Tim Smith) asks: > [ comments about Mac Servant and Switcher ] >Also, I thought that the Amiga only switched tasks when the currently >executing task does something that would block ( IO, or something like >the UNIX sleep or pause system calls )? Is this so? No, the Amiga switches tasks every few milliseconds or so. A task gets the processor only if it is not in the Wait() state, however, so if a task is just sitting there waiting for input, it does not take up any processor time. When the operating system gets a signal (such as in input event for the task, or whatever), it will wake up the task and tell it that an event has occurred. This is very different from the typical Mac program which sits there and loops until an event occurs. For example, on the Amiga, even when there is only one user program running, there are many tasks running. There is the task that takes care of the disk drive, the task taking care of input events, the Intuition granddaddy task, and so forth. (In fact, on the Amiga the OS is just a task, a task that runs at a VERY high priority and sleeps most of the time, waiting for input events. This is different from the UNIX OS which has a magic supervisor that takes care of system stuff.) Though there are many tasks in the system, in general they are all in the Wait() state until the user program or the user asks them to do something. For example, when the program asks for a read or write on the disk, that request is processed in a multitasking mode (i.e., the program can go do other things while waiting for the disk.) The Amiga has very fast context switching, since the whole OS is designed for multitasking performance. On the Mac, since the OS is not designed for multitasking, a context switch has to save a whole lot of information; thus Switcher only does a context switch when you ask it to do so, not automatically all the time as the Amiga Exec does. Thus using Switcher it is impossible to have two programs actually doing something at the same time, whereas on the Amiga this is trivial. On the other hand, Switcher does provide 75% of the functionality of multitasking, which is quick switching between multiple programs all loaded at once. For example, when I am using my Amiga the thing I do most often is switch back to my CLI window to do some disk operations while I'm running my editor or vt100 emulator or whatever. This does not really require multitasking, except when I am downloading I can still do it on an Amiga but not on a Mac. Also since the OS is always there as a task, even if the program is off doing some complicated thing, I can still front/back my windows, switch to a different screen, etc., much more rapidly on an Amiga than on a Mac. Servant was designed to support true context switching through what is called a "Servant task". Unfortunately there are almost no programs which run as "Servant tasks," so this is rather moot. I am told that Hertzfeld considered trying to implement true multitasking for regular Mac programs, but gave up when he realized that to do real-time context switching would slow down programs by an unacceptably huge factor (since you have to save almost all of the machine's state, rather than just the registers, as you would in a true multitasking environment.) It may be that more and more programs will be compiled to run as "Servant tasks" in which case the Mac will slowly become a multitasking machine. The Amiga has been multitasking from day one. The Amiga Exec is designed in a very beautiful way. The library system, etc. have been designed for both elegance and speed, as well as extensibility and backward-compatibility. The only real dog in the Amiga OS is the DOS, which was written by non-Amiga people, and thus is a total dog. It runs OK, but sort of breaks all of the OS rules, but it IS a multitasking DOS, so it does file locking and that sort of stuff. It works, but I wish it were as elegant and powerful as the rest of the Amiga OS. (Thanks Carl Sassenrath, RJ Mical, Jim Mackraz, etc., etc., etc.) One thing I have noticed is that the Amiga windowing system is lightning fast, in comparison with something like Suntools on the Sun. I mean Suntools practically rolled over and died while I was running a simple fractal generation program. I mean this is on a SUN/3, which has "real" hard disk drives, costs $30K, and two 68020s running at 14 Mhz to bench in at about 1 1/2 times faster than a VAX 11/785. Just trying to resize a window under Suntools became a monumental task, and the whole system hung when I tried to rewind the tape drive (it came back when the tape drive finished rewinding, and then proceeded to try to take care of all the mouse clicks and stuff I had been doing while it was dead, all at once. Ugh.) I mean, which is the REAL OS here, Amiga Exec/Intuition/DOS or the Suntools/UNIX? -Mitsu