2.1 Active as process, Static as Program – Process introduction

Question 1: The reason for the invention process?

The idea of processes was conceived by IBM engineers back in the 1960s and continues to this day. Computers were faced with the need to rotate and execute multiple tasks concurrently over a period of time. This required that each program occupy a separate memory space and that access be controlled by a uniform program number.

But when we write an operating system, we can’t predict what programs will run on it in the future. So we have to re-encapsulate all the programs that run on the operating system, so that they have some commonalities, so that we can design the various subsequent scheduling mechanisms.

Processes were invented to address program concurrency and resource sharing.Copy the code


Question 2: What is the definition of a process in a computer today?

Process is the Process of program execution.Copy the code

The definition of a process can be understood in several ways:

  • A process can be thought of as an abstraction of the laws of activity of a program running on a processor.
  • A process can be thought of as a data structure that encapsulates the execution of a program.
  • A process is the smallest independent entity designed by an operating system, with its own memory space and allocated computing power.
  • A process is a task job in an operating system that is responsible for one thing.

(I think the first definition is more vivid.)

It can be seen that the process emphasizes the process of execution. If the program is regarded as a mathematical problem, the process represents the process of doing the problem (start, pause, finish, give up). Processes are much more related to the processor CPU than they are to programs.


Question 3: Why are processes more closely related to processors?

Although a process is created by a program, after the program has created a process, the process has nothing to do with the program.

Operating systems are more concerned with the relationship between processes and processors.Copy the code

Because process is the equivalent of doing things, managers are more concerned about the relationship between the people doing things and the things.

A program, on the other hand, is essentially a binary array stored on a hard disk in the eyes of the operating system, requiring no effort at all to manage.

But a process is a process that runs in memory in real time, always hungry for computing power from the CPU, and the operating system must control its state, because the CPU can only give computing power to one process at a time.


Question 4: What are the main features of a process?

  • Memory space is independent. A process can only access its own memory space and some common registers, and must not access the memory space of other processes.
  • Processes are dynamic. When we treat a process, we must consider its current state. Whether the processor is in use or waiting for the processor.
  • Two processes created by the same program, their memory space is still independent, cannot access each other.
  • Each process has its own independent number, which is not repeated.


Question 5: The main state of the process:

Note: Determining the status of the process is the focus of the examination and studyCopy the code
  • Create: the program from the hard disk copy to memory into a process, requires the CPU to execute.
  • Running: The process is being executed by the CPU.
  • Wait: Waiting for some external operation (I/O data input, signal) that is not assigned to the processor.
  • Ready: The state of the CPU that is waiting for the operation to finish but has not yet been allocated.
  • Termination: a program completes execution or is forcibly logged out by the operating system, freeing up occupied memory space.

Process is the core of operating system learning, is the foundation of all subsequent learning, must think more. The key is to understand that two points have independent memory space and five states of the CPUCopy the code

Zobol by Computer Operating system Learning Notes