[Linux] basic concepts of C language and Linux System Programming process
1. If files are the most important abstract concept of unix systems, processes are second only to files. A process is the target code in execution: active, surviving, and running programs.
In addition to the target code process, it also contains data, resources, statuses, and virtualized computers.
2. Process System:
Each process has a unique positive integer identifier, namely, the process ID (pid). The pid of the first process is 1, and then each process receives a new unique pid.
In linux, processes have a strict hierarchy, which is a well-known process tree. The process tree takes the first process, that is, the init process as the root. The new process is created by calling the fork () system. Fork () copies the calling process. The original process is called the parent process, and the new process is called the child process. In addition to the first process, each process has a parent process.
3. Signal
A signal is a one-way asynchronous notification mechanism. A signal may be sent from the kernel to a process, from a process to a process, or from a process to itself. Signals are generally used to notify the process of certain events.
The Linux kernel implements about 30 signals, each of which is represented by a constant bright number and a text name. In addition to SIGKILL and SIGSTOP, processes can be controlled based on received signals.
4. inter-process communication
One of the most important tasks of the operating system is to allow processes to exchange information and notify each other of events. The Linux kernel implements the traditional unix inter-process communication (IPC) mechanism.
The inter-process communication mechanisms supported by linux include pipelines, named pipelines, semaphores, message queues, shared memory, and fast user space mutex.