coop/preempt [was: Re: release 0.0.0.20 and thoughts]

rdm@tad.micro.umn.edu rdm@tad.micro.umn.edu
Tue, 22 Aug 1995 18:10:01 -0400


Billy Tanksley:
   Coop has a bad image, earned from many bad implementations.  In
   addition, coop is strictly less than preemptive (which is an
   advantage to the system, but a disadvantage to any marketing
   department).  Nonetheless, the fact that you, or anyone else would
   hate the system should not dissuade us from considering it.

The reason coop has a bad rep is that the performance of the system --
as a whole -- depends very strongly upon the individual apps.

coop works great if there's only a single logical app running (e.g. a
game) -- here it's pretty obvious what's going on.  However, if
there's a whole bunch of apps (say, a bank of terminal emulators, and
a handfull of browsers of various sorts), then things become more
problematic.

The code could perform very well under cooperative multi-tasking, but
then it might be re-configured (customized) by some end-user in a way
that the original designer hadn't considered.  Here, there might be a
5-30 second pause while some normally "almost instant" operation is
being performed.  Now, the system is crawling and there's no real
recourse without re-building the entire application.

Another alternative is to put yields in far, far more frequently than
they're "really needed" (especially, in inner loops that may run for a
long time).  Here, all of a sudden your cooperative multi-tasking has
a lot of overhead that's really unnecessary.

And, remember, when you are talking about proofs, you not only need to
prove that the present app does it's yields properly, you need to
prove that >>all other apps<< have adequate yields for this app to run
correctly.

It's just too easy to write some application in a
non-cooperative-multitasking-friendly manner, because "it'll never be
a problem."  Remember, most proofs are going to be about specific test
cases, rather than any sort of general case.

Or, another way of looking at this is: the effort you save by not
providing pre-emptive multi-tasking in the OS is going to have to be
made for each application that needs pre-emptive multi-tasking in a
cooperative multi-tasking environment -- as well as all applications
that will be run with it.

This sort of cost savings can easily make you go broke.

-- 
Raul