Linux kernel design and implementation--reading NOTE 2: Process management

Source: Internet
Author: User

1. Process:

(1) The procedure is in the execution period, but not only the code, but also the resources required to run the various programs, in fact the process is executing

Real-time results of the program.

(2) The procedure itself is not a process, and the process is the general term of the procedure and its related resources at the time of execution.

(3) Two or more concurrent processes can share shared resources such as open files, address spaces, and so on.

(4) in Linux, the result of calling the fork () system function is usually called by copying an existing process to create a new child process.

Fork () system functions

(5) Fork at the end of this system call, return two times in the same location (two times from the kernel), the parent process resumes running, the child process begins to run.

EXEC () system functions

(6) Exce This set of functions can create new address spaces and load new programs into them.

Exit () system function

(7) The program exits execution through the exit () system call, which ends the process and frees the resources it consumes

WAIT4 () system functions

(8) The parent process uses the WAIT4 () system to query whether the child process is terminated.

Thread of execution: a thread, an object that is active in a process, each with a separate program counter, a process stack, and a set of process registers.

2. Process descriptor and its task structure

(1) Task queue: A two-way loop linked list of processes that are stored

(2) Process descriptor: The type of each element of the list, the structure of the task_stuct, contains the data to fully describe an executing program of all information, include: Open file, process address space, pending signal, status of process, etc...

(3) Assignment Process descriptor: Linux allocates the TASK_STRUCT structure through the slab allocator, and the THREAD_INFO structure of each task in the end of its kernel stack allocates a task field in the structure that is the actual task_struct pointer to the task.

(4) Process descriptor storage: The kernel identifies each process by a unique process flag value or PID value, and the PID is a number that is represented as a pid_t implied type

is actually an int type.

(5)

Linux kernel design and implementation--reading NOTE 2: Process management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.