Unix system programming () processes and programs

Source: Internet
Author: User

A process is an instance of an executable program.

A program is a file that contains a series of information that describes how to create a process at run time, including the following.

Binary format identification: Each program file contains meta information (metainformation) that describes the format of the executable file. The kernel (kernel) uses this information to interpret other information in the file.

Historically, Unix executables have had two widely used formats, namely the original a.out (assembler output) and the more complex COFF (Common Object file format).

Most UNIX implementations (including Linux) now employ the executable connection format (ELF), which has more advantages than the old version format.

Machine language instruction: encode the program algorithm.

Program Entry Address: Identifies the starting command location when the program starts executing.

Data: The program file contains the variable initial value and the literal constant (literal constant) value (such as a string) used by the program.

Symbol table and Relocation table: Describes the location and name of functions and variables in the program. These tables are used for a variety of purposes, including debugging and symbolic parsing at runtime (dynamic linking).

Shared libraries and dynamic Link information: Some of the fields included in the Program Files list the shared libraries that are required for the program to run, and the path names of the dynamic linker that loads the shared library.

Additional Information: The program file also contains many additional information that describes how to create a process.

You can use a program to create many processes, or in turn, many processes can run the same program.

The process is now defined as an abstract entity defined by the kernel, and the entity is assigned the system resources used to execute the program.

From the kernel point of view, the process consists of a user memory space (user-space memory) and a series of kernel data structures, where the user memory space contains the program code and the variables used by the code, and the kernel data structure is used to maintain process state information.

The information recorded in the kernel data structure includes many process-related identification numbers (IDS), virtual memory tables, open file descriptors, signal delivery and processing information, process resource usage and limitations, current working directory, and a large amount of other information.

It seems that a process up still contains a lot of things ah.

Unix system programming () processes and programs

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.