8 Chapter 1 Introduction to Computers, Programs, and Java
1.4.2 Allocating and Assigning System Resources
The operating system is responsible for determining what computer resources a program
needs (e.g., CPU, memory, disks, input and output devices) and for allocating and assigning
them to run the program.
1.4.3 Scheduling Operations
The OS is responsible for scheduling programs to make efficient use of system resources. Many
of today’s operating systems support such techniques as multiprogramming,multithreading, or
multiprocessingto increase system performance.
Multiprogrammingallows multiple programs to run simultaneously by sharing the CPU.
The CPU is much faster than the computer’s other components. As a result, it is idle most of
the time—for example, while waiting for data to be transferred from the disk or from other
sources. A multiprogramming OS takes advantage of this situation by allowing multiple pro-
grams to use the CPU when it would otherwise be idle. For example, you may use a word
processor to edit a file at the same time as the Web browser is downloading a file.
Multithreading allows concurrency within a program, so that its subtasks can run at the
same time. For example, a word-processing program allows users to simultaneously edit text
and save it to a file. In this example, editing and saving are two tasks within the same applica-
tion. These two tasks may run on separate threads concurrently.
Multiprocessing, or parallel processing, uses two or more processors together to perform a
task. It is like a surgical operation where several doctors work together on one patient.
1.5 Java, World Wide Web, and Beyond
This book introduces Java programming. Java was developed by a team led by James
Gosling at Sun Microsystems. Originally called Oak, it was designed in 1991 for use in
embedded chips in consumer electronic appliances. In 1995, renamed Java, it was
redesigned for developing Internet applications. For the history of Java, see
java.sun.com/features/1998/05/birthday.html.
Java has become enormously popular. Its rapid rise and wide acceptance can be traced to
its design characteristics, particularly its promise that you can write a program once and run it
anywhere. As stated by Sun, Java is simple,object oriented, distributed, interpreted, robust,
secure,architecture neutral, portable, high performance,multithreaded, and dynamic. For the
anatomy of Java characteristics, see www.cs.armstrong.edu/liang/JavaCharacteristics.pdf.
Java is a full-featured, general-purpose programming language that can be used to develop
robust mission-critical applications. Today, it is employed not only for Web programming, but
also for developing standalone applications across platforms on servers, desktops, and mobile
devices. It was used to develop the code to communicate with and control the robotic rover on
Mars. Many companies that once considered Java to be more hype than substance are now
using it to create distributed applications accessed by customers and partners across the Inter-
net. For every new project being developed today, companies are asking how they can use
Java to make their work easier.
The World Wide Web is an electronic information repository that can be accessed on the
Internet from anywhere in the world. The Internet, the Web’s infrastructure, has been around
for more than thirty years. The colorful World Wide Web and sophisticated Web browsers are
the major reason for the Internet’s popularity.
The primary authoring language for the Web is the Hypertext Markup Language (HTML).
HTML is a simple language for laying out documents, linking documents on the Internet, and
bringing images, sound, and video alive on the Web. However, it cannot interact with the user
except through simple forms. Web pages in HTML are essentially static and flat.
Java initially became attractive because Java programs can be run from a Web browser.
Such programs are called applets. Applets employ a modern graphical interface with buttons,
multiprogramming
multithreading
multiprocessing
applet