homework2 Version 0 |
|
👤 Author: by 1730854984qqcom 2020-09-23 06:43:55 |
1. What is the purpose of process?
Early computer systems allowed only one program to be executed at a time. The program has complete control over the system and access to all system resources. Modern computer systems allow multiple programs to be brought into memory for concurrent execution. This requirement provides for stricter control and better division of procedures. These requirements give rise to the concept of a process, a program in progress. A process is a unit of work in a modern time-sharing system.
2. Describe their relation and difference for process and program.
In informal parlance, a process is an executing program. A process is not just program code, it also includes the current activity. In addition, a process usually includes a process stack segment, a data segment, and possibly a heap. The program itself is not a process; A program is just a passive entity, such as the contents of a file that contains a series of instructions stored on disk, while a process is an active entity that has a program counter that represents the next command to execute and the associated set of resources. When an executable file is loaded into memory, a program becomes a process.
3. Why the status of process is divided into five states, not other numbers, such as 4,7?
As a process executes, it changes state
new: The process is being created
running: Instructions are being executed
waiting: The process is waiting for some event to occur
ready: The process is waiting to be assigned to a process
terminated: The process has finished execution
The names of these states are arbitrary and vary from operating system to operating system. However, the states they represent can occur on all systems. Some systems describe process state in more detail. The five states are distinguished to facilitate system management and control of processes. These five states basically cover the state of the process at execution time.