91热爆

Multitasking and memory management

Multitasking

Multitasking means to be able to run more than one program simultaneously. In the past, computers with CLIs were unable to multitask - the operating systems of the day only allowed one program to run at a time.

Modern operating systems are multitasking in that they allow several programs to run side-by-side. It is not uncommon for a user to be music while entering text into a , or streaming a video while making a of files.

Multitasking is possible only if:

  • the operating system can support multitasking
  • the computer has enough memory to hold more than one program in primary memory at the same time

Memory management

Computer memory must be managed to ensure that:

  • more than one program can run at the same time
  • more than one document can be opened at the same time

One method of memory management is known as . Memory is broken up into fixed-size blocks, known as .

Different operating systems allocate their own size to pages. For example, memory pages in modern operating systems are typically 4 kilobytes (KB) in size.

When a program is run, it is loaded into memory. The operating system determines how much memory the program requires, and allocates enough pages to hold it and its documents. When the program is closed, the allocated pages are freed up for use by other programs.

The pages a program occupies may or may not be , but this does not matter. The operating system knows what each page occupies and fetches the data held in them when needed.

Consider this example. Program A requires two pages. It is allocated pages 0 and 1. Program B requires three pages. It is allocated pages 2, 3 and 4.

Table with programs that have been loaded to memory and allocated pages

Program A now closes, and Program C now runs. Program C requires three pages. Pages 0 and 1 are now free, so Program C is allocated pages 0, 1 and 5.

Table with programs that have been loaded to memory and allocated pages

Peripherals and drivers

Peripherals are hardware devices connected to a computer, such as a monitor, printer, scanner or camera.

To operate a peripheral, the operating system uses a program called a . Device drivers contain instructions on how to control a device. Each connected device has its own driver.

Using device drivers brings two advantages:

  • any device can be used with the operating system, as long as a driver is available for it
  • drivers can be updated, usually to give better performance or to remove a

File handling

File handling and file maintenance is one of the most important tasks of an operating system. The file handling software allows users to:

  • create, modify and delete files and folders
  • copy and duplicate files and folders
  • move files and folders
  • rename files and folders
  • sort items into different orders, according to name, file type, date created and more
  • search for particular files and folders
  • restore deleted files
  • set access rights to files such as read only or edit

User management

Operating systems also manage users. They allow:

  • individual users to be created and deleted
  • access levels to be given to users, such as administrator rights or standard user rights
  • auditing (keeping a log) of files a user creates, accesses, edits and deletes