Re: re *-multitask

Roland John Turner (rjturner@nospam.socs.uts.edu.au)
Fri, 12 Jan 1996 09:33:34 +1100 (EST)

Peter Lees wrote:
>
> Roland John Turner wrote...
> >
> > This is a pretty common misconception. Both Win3 and Win95 DO pre-empt.
> > In other words, background apps CAN be running. Several bits of Win3 would
> > work even less well if this wasn't the case.
>
> the _can_ is the gotcha. my understanding was that (in win3) the
> foreground process had to be instructed to give up cpu cycles to allow
> background processes to run; which is kind of co-operative multitasking.

Not quite. The preferred form of multi-tasking in Win3 is co-operative.
This is a hangover from Win2 which could not pre-empt at all. Win3
however can and does pre-empt. BUT the default behaviour for DOS apps is
to not do any background execution. This is what the background execution
setting for DOS apps is all about. Win3 apps on the other hand do perform
background execution by default.

I guess the water is muddied somewhat by the fact the MS chose to make
pre-emption non-default behavior in order to boost performance.

> raz, can you give an illistrative example of how win3 pre-emptively
> multitasks (or a useful application of its abilities?)

(N.B. This from memory - check debug syntax before trying it yourself.)

C:\>debug
- a100
100:0 jmp 100
104:0 .
- g=100

The process is now running non co-operatively, making no system calls and
using 100% of the CPU cycles given to it. Enable background execution and
drop it into the background. Win3 will still work. If Win3 weren't pre-empting,
this exercise would lock up the machine.

> as an aside on this whole os thing, has anyone seen the BeBox yet?
> http://www.be.com . looks like fun.

No. I keep hearing about it - should probably investigate!

- Raz rjturner@nospam.socs.uts.edu.au

"It often upsets a man's God fantasies to have (Misquoted? from )
someone shoot down one of his helicopters." (Ben Elton's "Stark" )