Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucla-cs!ucla-seas!boole.seas.ucla.edu From: plinio@boole.seas.ucla.edu (Plinio Barbeito/) Newsgroups: comp.sys.atari.st Subject: Re: Multitasking Summary: Advantages, Disadvantages Message-ID: <1976@lee.SEAS.UCLA.EDU> Date: 14 Feb 91 04:30:43 GMT References: <74457@bu.edu.bu.edu> <1991Feb11.151210.4010@informatik.uni-erlangen.de> Sender: news@SEAS.UCLA.EDU Organization: SEASnet, University of California, Los Angeles Lines: 115 In article <1991Feb11.151210.4010@informatik.uni-erlangen.de> lsmichae@immd4.informatik.uni-erlangen.de (Lars Michael ) writes: >selick@bucsf.bu.edu (Steven Selick) writes: > >>Depending on the methods you choose to do your application switching, >>you can buffer i/o and such to maximize your productivity, but you still >>are performing one function on the processor at any given clock tick. > >I really agree with you, *but* a multitasking system slices one second >so all non-blocked processes get one or more slices of time. This is >transparent for the user, so he may think he has *all* his processes >running. Provided the time for a task switch is small enough. If task switches were done every 10 seconds (and there's no law saying you can't), the user would notice. Make task switches every microsecond and again the user notices something: a darn slow machine (due to overhead -- I'll explain below). > >Actually multitasking can help you e.g. in programming. Lets compare: OK, let's compare. I'll try to balance the argument with the disadvantages. > >Monotasking: > You write some source with the editor, leave the editor, compile, > debug, find an error and start the editor again. Each application > has to be left before the next can run. Plus, each application runs at the full speed of the processor without being interrupted every now and then so that the scheduler can start up to "direct traffic". Thus, in its simplicity, a single-tasking system avoids the typical 10-40% overhead on the processor due to the kernel having to do its housekeeping (e.g. basically "asking" each process "Do you want to run now?"). An 8MHz single-tasking machine running a given program would appear to be a 7.2 MHz machine if it had multitasking overhead of only 10%. Since a lot of the time a single-user machine like the ST only needs to be running one program, there'd better be a good reason to penalize the user with a significant amount of overhead all the time. Once two processes start running at the same time, each process will seem slower because they are sharing the processor time with each other and the scheduler; each process will then be running at 50% speed (minus the speed of the overhead). If one of them stops to wait for the disk, say, then the other usually gains back the entire processor minus the overhead (minus any slowdown due to the disk transfer and the processor trying to use memory at the same time). Run too many other processes, and the machine may become unusably slow. The user might be frustrated to press a key and not get the expected response (yet). He might start to think that the machine is hung. To get around this, some schedulers pre-empt the processor so that that the user is still able to type, use the mouse...at nearly the speed he is accustomed (at the expense of other processes). But this adds even more code to the scheduler which you are trying to keep small because of overhead. In addition, if there is neither multitasking nor task switching, each application has the entire memory space to itself, so it will not crash due to some other processes having tweaked its memory space (sometimes by accident, sometimes by ignorance...sometimes on purpose ];-D ). > >Multitasking: > Load all applications before use, and switch (without loading) > only to the one you wanna use. Indeed this is faster ! > What you've described is only task-switching. When you type control-Z from Gulam's built-in 'ue' editor to go back to the shell, or type fg to go back in, you are task-switching. You are also task switching if you are in Gulam's terminal emulator and press the Undo key to go back to the shell screen. Indeed this is fast. But Multitasking is having many processes loaded AND (potentially) running at the same time. It means that two processes that don't know what each other does can possibly be using the other's memory without its permission. I don't mean to imply that because a machine is multitasking it will always be crashing. In fact, I prefer being able to start it up, if only because I like to keep editing while I'm compiling a large program. But on a machine with no MMU, it is necessarily risky. Say you had ten processes running at the same time. The risk is ten times higher that some of the code in RAM will have a bug in it or will misbehave. You have to be doubly careful if you are doing serious work, and at the same time you are starting up a new program that you haven't used before. So you save your files and wait for the save to finish before you try the experimental stuff. To be even more sure that the new program hasn't smashed a part of the data in the other programs, you quit the other programs. You don't want part of the program you're writing to have a bunch of funny characters in it all of a sudden. And to be safe from having the operating system's tables (which it has to have in RAM to multitask) tweaked by the program, providing wierd behaviour later, you quit the operating system. Yes, you can do this with MiNT (and possibly Beckemeyer's MT C-shell) on the ST, by exiting the top-level shell. >>the price, and I was happy enough with my 1040st to upgrade to an STE >>(mainly for the blitter chip, tos 1.6, and memory upgrade, but what else >>is there?) > hardware scrolling horizontal and vertical > four Joystick ports (plus two internal ports ?) > stereo digital sound > and some features which I don't know. there is also a 4096 color palette, and I think it has RCA jacks (ports?) for the stereo audio, and the ability to add more memory with SIMM's. plini b -- ----- ---- --- -- ------ ---- --- -- - - - plinio@seas.ucla.edu Putting the Ctrl key under shift; replacing it with CAPSLOCK, is like putting the steering wheel in the trunk, and trying to drive with the spare tire.