Re[2]: [Am-info] O/S 2 support - slightly off topic (my apologies)

Erick Andrews Erick Andrews" <eandrews@star.net
Sat, 16 Mar 2002 15:41:25 -0400 (EDT)


On Sat, 16 Mar 2002 12:12:55 -0800, Mitch Stone wrote:

>Allow me to ask a simple-minded technical question: what if anything is 
>the relationship between multithreading and preemptive multitasking?
>
>The main reason I ask, is because for years we heard that the MacOS was 
>technically inferior to Windows because it used a less sophisticated 
>scheme for multitasking (cooperative). This method gave explicit CPU 
>priority to the front-most active application. What I've found since 
>moving to the threaded OS X, is that the performance of some power-hungry 
>apps suffers because these priorities can no longer be set (as readily) by 
>the user.
>

Like all complex programming/coding, there are right and wrong ways,
or perhaps I should say, not-so-good v. better ways of implementation.

Multithreading and preemptive multitasking are not exactly the same
things, at least in current Warp-OS/2-eComstation environments.

You can have multiple programs running in a multitasking system
that have only one "thread" each, but the OS "pauses" or "preempts"
the running application to give CPU time to another.  In OS/2
this is a kernel function and is familiarly called "round robin", which
*is* rather sophisticated.  OS/2's implementation of multitasking is
a study in itself.  

Multithreading is another level and needs to be (thoughtfully)
written into the application so that the overall goal is to maximize
CPU utilization...to use as many CPU cycles as possible to keep high
efficiency, that is, overall high throughput for the system.  The effect
of both multitasking and subsequent application multithreading (well
written) achieves very good performance, and prevents one application
from "hogging" the system.  Oh yes, there is a "priority scheme", 4 types
with 32 levels each in OS/2, to help harmonized everything.  Some
threads, like communications services, typically need to run at the 
highest priority.

"Cooperative multitasking" totally depends on the application "co-
operating" to give up time for another application, IOW, the OS
does not have as much control over all execution.

I'm sure some of the other OS/2 folks on this list can clarify more.

-- 
Erick Andrews