Operating Systems

Popular operating systems for general-purpose computers are Microsoft Windows, Mac OS, and Linux. Application programs, such as a Web browser or a word processor, cannot run unless an operating system is installed and running on the computer. Figure 1.10 shows the interrelationship of user, application programs, operating system, and hardware.

Figure 1.10 Users and applications access the computer’s hardware via the operating system.

The following are major tasks of an operating system:

  • Controlling and monitoring system activities
  • Allocating and assigning system resources
  • Scheduling operations

1. Controlling and Monitoring System Activities

Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the monitor, organizing files and folders on storage devices, and controlling periph­eral devices, such as disk drives and printers. Operating systems also ensure that different programs and users working simultaneously do not interfere with each other. In addition, the OS is responsible for security, ensuring that unauthorized users and programs do not access the system.

2. Allocating and Assigning System Resources

The OS is responsible for determining what computer resources a program needs (such as CPU time, memory space, disks, and input and output devices) and for allocating and assign­ing them to run the program.

3. Scheduling Operations

The OS is responsible for scheduling programs’ activities to make efficient use of system resources. To increase system performance, many of today’s operating systems support such techniques as multiprogramming, multithreading, and multiprocessing.

Multiprogramming allows 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 a disk or waiting for other system resources to respond. A multiprogramming OS takes advantage of this situation by allowing multiple programs to use the CPU when it would otherwise be idle. For example, multiprogramming enables you to use a word processor to edit a file at the same time as your Web browser is downloading a file.

Multithreading allows a single program to execute multiple tasks at the same time. For instance, a word-processing program allows users to simultaneously edit text and save it to a disk. In this example, editing and saving are two tasks within the same application. These two tasks may run concurrently.

Multiprocessing, or parallel processing, uses two or more processors together to perform subtasks concurrently and then combine solutions of the subtasks to obtain a solution for the entire task. It is like a surgical operation where several doctors work together on one patient.

Source: Liang Y. Daniel (2013), Introduction to programming with C++, Pearson; 3rd edition.

Leave a Reply

Your email address will not be published. Required fields are marked *