NewDeal Hot Tip 1514
Multitasking and Chewing Gum
NewDeal software runs in a preemptive, multithreaded multitasking
environment. But what does that mean? Here's an explanation
from one of the designers of the software.
The Walking and Chewing Gum Theory
Single-Tasking: You are walking down the street and
you decide you would like to chew gum. You stop, untie your
shoes and take them off, get a pack of gum from your pocket,
take out a stick, put it in your mouth and then chew. When
you are done chewing you remove the gum from your mouth,
place it carefully back inside the wrapper, put it in your
pocket, put back on your shoes and then continue to walk.
Task-Switching: You are walking down the street and
you decide you would like to chew gum. You slip out of your
loafers, grab the piece of gum you have stashed behind your
ear for just such an emergency and chew, chew, chew. When
you are done chewing, you remove the gum from your mouth
and quickly place it behind your ear (making sure, of
course, that no one sees you do something so disgusting),
slip back on your loafers and continue walking.
Cooperative Multi-tasking: You are walking down the
street with gum in your mouth. Your shoes have been
specially designed to release your brain at the end of
every other step. As soon as your brain is free it notices
that you have gum in your mouth. You chew your gum twice.
Your gum then releases its grip on your brain. Your brain
looks around and realizes that you are standing in the
middle of a busy street with your mouth open. You quickly
start to walk, hoping that you will reach the sidewalk
before you are hit by a car and lose your gum. Warning,
there may be bugs in your shoes or your gum. Several users
have reported uncontrollable chewing while standing on one leg.
Pre-Emptive Multi-tasking: You are walking down
the street and chewing your gum just like the other
coordinated human beings. Little do they know you are
really an android: a flesh covered machine from the future,
stalking the streets of the city, looking for a haircut.
In simple terms
- This is the classic way to run programs from DOS.
When you run an application, it is the only program
running on the computer. To run another application,
you must first shut down the current program completely.
- This is the way that programs run when using
TaskMax from DR-DOS or when running DOS applications
from Microsoft Windows. When you run an application, it
is the only thing running on the computer, but other
applications may be in a suspended state, ready to take
up where they left off when you task switch back to them.
- Cooperative Multi-tasking
- This is the kind of multitasking provided by
Windows 3.1 for its own applications. Each application must
be designed to release the computer's processor periodically
so that other applications can run. Poorly designed applications
or certain processes in some applications may not release
the processor, resulting in periods of time when only
one application is running.
- Pre-Emptive Multi-tasking
- The right way to multitask. The system controls the
allocation of processor time to all the applications, so that
many applications can run at the same time.
Return to Index
Last Modified 2 Mar 1999