Pre-emptive vs. Cooperative Multitasking

Francois-Rene Rideau
Fri, 21 Jul 95 0:49:24 MET DST

">>" is Jecel,
">" is Billy.

>> Some intersting hybrid schemes have been built. The Transputer is
>> an example. [...]
Hey, this is exactly what I've been describing in the LLL page at URL
"" !

>>   - Cooperative Multitasking: Mostly avoids the need to explicitly
>>     control resource sharing. Allows you to violate "invariants"
>>     to boost performance as long as things are restored to normal
>>     before the next task switching point.

> Note that all that good stuff is destroyed by the fact that you must poll 
> for tasks at all other times.
   Polling costs almost nothing as compared to the heavy cost of complete
state saving. Saving the complete state costs thousands of cycles. If well
implemented, polling costs some ten cycles each time. If even better
implemented, it costs nothing at all (see URL above).

> Essentially, the only advantage I can see for cooperative MT is during 
> short critical loops, and why not just explicitly give those loops 
> control?
   Cooperation is just *required* for persistency, inter-thread and
distributed GC (remember, TUNES is to provide all that, too). Of course,
you could use "conservative" GC and persistency, but that sures costs much
more than cooperative schemes. By writing cooperative code, you pay once and
for all when you write the compiler; by promoting anarchy, you must be
paranoid, and you never cease to pay the cost.
   Cooperation is to follow laws, to increase information. It does *not*
oppose preemption. It opposes absence of cooperation, which is anarchy.

--    ,        	                                ,           _ v    ~  ^  --
-- Fare -- -- Francois-Rene Rideau -- +)ang-Vu Ban --
--                                      '                   / .          --
Join the TUNES project for a computing system based on computing freedom !
		   TUNES is a Useful, Not Expedient System
WWW page at URL: ""