X-Organization: University of Wisconsin--Platteville
X-Envelope-to: I-AMIGA@UBVM.cc.buffalo.edu
X-VMS-To: IN%"I-AMIGA@UBVM.cc.buffalo.edu"
X-VMS-Cc: 96720919
Newsgroups: bit.listserv.i-amiga
Date:         Fri, 6 Nov 1992 11:37:00 CST
From:         Lance Tagliapietra <96720919@UCS.UWPLATT.EDU>
Subject:      Re: The 1200

>Date: Wed, 4 Nov 1992 11:25:37 +0100
>From: "(Jorrit Tyberghein)" <jorrit@UZ.KULEUVEN.AC.BE>
>Subject: RE: The 1200
>
>> Okay, people, now I am confused...
>>
>> A while back someone said that Workbench uses cooperative multitasking, now
>> someone says its preemptive...???
>>
>> Someone that is 100% sure, please, tell me (us) which it is?
>>
>> And how is it "better" (i.e. faster, more efficient, more process
>> friendly) than the other?
>>
>> Greatly appreciated!
>>
>> Robert
>
>I'm 100% sure Workbench is PREEMPTIVE. Windows and Macintosh use COOPERATIVE
>multitasking while OS/2 and Unix also use PREEMPTIVE multitasking.

Not quite.  AmigaDos implements the preemptive multitasking used on the
Amiga.  WorkBench is the graphical user interface which runs under AmigaDos.
Workbench (as a program) does not multitask.  Workbench cannot start another
program while it is currently launching one.  If Workbench multitasked, you
would never see the busy pointer, at least not as long as you tend to see
it now.

The discussion of preemptive and cooperative multitasking are correct though.

>
>With cooperative multitasking a task switch only occurs when the program
>wants it (either by executing some input/output function or by explicitely
>giving control back to the operating system). If the program hangs in an
>infinite loop it will not give control back to the operating system and
>the computer will hang. You will not be able to use any of the other programs
>in memory.
>
>With preemptive multitasking any task may be 'preempted' at any time in
>favor of another task. When a program goes in an infinite loop other programs
>will still be able to run once in a while. On Amiga this preemptive
>multitasking is implemented with a priority based round-robin algorithm. This
>means that tasks with the same priority get equal share of the processor.
>A task with a higher priority however, will never get preempted because of
>a task with a lower priority. The task with the lower priority will get a
>chance to run only when the higher priority task is waiting for input/output
>or something like that (note! not busy waiting). This technique ensures that
>tasks with important services can make sure they have the processor while
>they need it. Most programs on Amiga use priority 0. Some very important
>tasks like the 'input.device' (manages mouse, keyboard and timer input
>from the hardware) have a priority of 20. It is because of this high
>priority that the responsiveness of the mouse and keyboard on Amiga are
>always guaranteed (except when multitasking is disabled of course).
>
>Preemptive multitasking is not always faster than cooperative multitasking
>but the user will get a better overall respons because all programs get
>about the same share.
>
>The difficulty with preemptive multitasking is that you can expect that
>your task may be halted between any two machinelanguage instructions.
>If you want to look at system lists you must be careful. Semaphores can
>be used to solve this problem. With semaphores you can implement process
>synchronization so that you can be sure that your task is the only one
>that can look at a specific system list at that time.
>
>
>-----------------------------------------------------------------------------
>Jorrit Tyberghein : author of PowerVisor
>-----------------------------------------------------------------------------

-Lance
 ---------------- Amiga - The Wild Side of Power Computing -----------------
 Lance Tagliapietra                       Internet: 96720919@ucs.uwplatt.edu
 P.O. Box 26                                BitNet: 96720919@uwplatt
 Platteville, WI 53818
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU