Hardware Reference
In-Depth Information
Introducing Scheduling
Back in the early days of computing, computers could do only one thing at a
time. When you turned on your trusty PC and put in a disk, the operating system
started. Then you changed the disk and ran a spreadsheet. Your spreadsheet
appeared on the screen after a few seconds and you heard some dubious sounds
from the disk drive, and then, i nally, you could get to work. If you wanted to
take a break and play a game in glorious four colors, you had to save your work
and quit the spreadsheet (or in some cases, actually restart the computer) before
playing a game. With disks, this didn't matter so much; you couldn't have two
programs open at the same time.
When graphical systems arrived on the PC, users wanted to have windows
containing their applications, but they also wanted to switch from one applica-
tion to another, or even have two running at the same time. Hard drives could
store several programs, and there was enough system memory to have multiple
executables in memory at the same time. The question was, how do you run
two programs at the same time?
Computer manufacturers started selling computers with graphical systems
with a lot of memory and internal hard drives, and this became standard.
The more they added on, the more users wanted. To attract users, they would
say that you could run several programs at the same time and that they
could run simultaneously. This is one of the biggest lies in computers, but it
is close enough.
A processor cannot execute multiple programs at the same time; technically it
isn't possible. A processor can execute the instructions it is given, one at a time,
but the trick is in giving it the instructions it needs to run.
The operating system is the software heart of any system. An application
cannot run without the help of an operating system. Even if you use only one
program, you can't just install that program onto a computer without an oper-
ating system. The operating system does much more than just run programs;
it sets up the hardware, including keyboard and mouse inputs, and video out-
put, and it coni gures the memory as required—something a normal program
doesn't need. A program can tell the operating system to print something on
the screen, and it is the operating system that does all the hard work, includ-
ing multitasking.
Multitasking is the art of running several programs in a way that makes
users think that they are running at exactly the same time, but they aren't. The
operating system gives control to an application (or thread) before either taking
back control or waiting until the application gives control back to the operating
system, as shown in Figure 19-1.
 
Search WWH ::




Custom Search