Q1. What are the concepts of programs and processes? Why should we introduce the concept of "process?
A:
1) a program is a common file and a collection of machine code commands and data. These commands and data are stored in an executable image on the disk. the executable image) is the content of an executable file;
2) A process represents the execution process of a program. It is a dynamic entity and constantly changes with the execution of commands in the program, the process content at a specific time point is called a process image );
3) the execution process of a program can be said to be the sum of an execution environment, which includes some additional data in addition to various instructions and data in the program; the dynamic changes in the execution environment reflect the running of the program. to describe the process of dynamic changes, the concept of "process" is introduced.
Q2. what is a process control block? What basic information does it contain?
A:
1) in Linux, the description structure of processes is called task_struct, and such a data structure is called a process control block (PCB );
2) PCB is a massive data structure with more than 80 segments. All domains are divided into status information based on their functions, link information, various identifiers, inter-process communication information, time and timer information, scheduling information, file system information, virtual memory information, and processor environment information.
Q3. What are the Linux kernel statuses?
A:
1) There are three basic processes in Linux: the running state, the ready state, and the blocking state (or the waiting state). There are four possible conversion relationships between these three states: running State-> blocking state, running state-> ready state, ready state-> running state and blocking state-> ready state;
2) For ease of management, combine the ready state and running state into a state-runable state, including other changes, and divide the process state: operational, sleep (or waiting), paused, and frozen.
Q4. what are the PCB organization methods?
A: PCB is organized in the following ways: process linked list, scattered list, operational queue, and waiting queue.
Q5. what are the main scheduling algorithms? What aspects should a good scheduling algorithm consider?
A:
1) The main scheduling algorithms include: time slice rotation scheduling algorithm, Priority Scheduling Algorithm (non-preemptible Priority Algorithm and preemptible Priority Algorithm), multi-level feedback queue scheduling algorithm and real-time scheduling algorithm;
2) A good scheduling algorithm should consider five aspects: fairness, efficiency, response time, turnover time and throughput.
From: