Linux system --linux process and job Management (1)
Learn some basic concepts: kernel functions, program composition, process, process type and running state, process classification,Linux first process init,Linux the kernel stores process information in the format, process priority, and interprocess communication.
1. components of the Linux kernel's functions and programs:
the Linux kernel is an open-source computer operating system. is software used to deal with hardware and provide a limited set of services for user programs. the Linux kernel supports modularity, supports dynamic loading and unloading of modules, edits the module driver to the kernel, and directly calls the required modules without editing to the kernel. The main features of the Linux kernel are:
Process management, memory management, network management, drivers, file system and security features
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/82/wKioL1X_-VrDXrxqAAFQnEfZMe4936.jpg "title=" QQ picture 20150921202416.png "alt=" Wkiol1x_-vrdxrxqaafqnefzme4936.jpg "/>
System Invoke Interface (SCI:Systems callInterface): Is the only interface between the Linux kernel and the upper-level application for interactive communication. With this interface, the user can access the kernel space. SCI is a very useful function call multiplexing and multi-channel decomposition service.
Binary applications are made up of binary files, library files, configuration files, Help files.
2. process, type and operational status of the process, classification of the process:
Processis a running activity of a program on some data sets in a computer, and it is the basic unit of system resource allocation and dispatch. It can also be said that a copy of the program in operation, the existence of the life cycle.
Linux process types are: daemon and foreground process
Daemon: A process initiated during a system boot process that is not related to a terminal.
Foreground process: terminal-related, process initiated through terminal
You can send the process started in the foreground to the background and run in the daemon mode.
The running state of the process:
Operating state:Running
Ready state: Readiness
Sleep state:
Interruptible:interruptable: When waiting for a resource to be met, or another process wakes up by signal or clock interrupt
Non-interruptible:uninterruptable: Can only be awakened by waiting for a resource to be satisfied, not by another process
Stop state: Paused in memory, but not dispatched unless manually started.
Receive several signals and enter the paused state:
SIGSTOP --> stop Process Execution
SIGTSTP-----> signal stop process from terminal
Sigttin-----> from keyboard interrupts
Sigttou----> background process request output
Zombie State:zombie process has ended and most resources have been released, but its PCB has not been released
Classification of processes:
Compute-intensive: (cpu-bound) in multiple programs, most of the time for computing, logical judgment and other CPU Actions
I/O intensive: (i/o-bound) Handles I/O operations in most cases
3. First process init in Linux
Linux starts the system's first user-state process init process with a process ID of 1.
At the end of the system boot phase, the kernel part of the operating system is initialized, and This first user-state program is run, which is the parent process for all user processes, which will be based on the /etc/inittab Configure the file to initialize the system to the user.
user enable command is not really running run level switch work, knowledge through pipe packing the command into request daemon process run init
After the system starts, init runs as a daemon process, monitoring the execution of related commands in the/etc/inittab configuration file, The second is to switch the run level and handle it by receiving requests from the pipeline
4. format of the Linux kernel storage process Information
InLinuxeach process in atask_structdata structures to define. task_structThat's what we always say.PCB(Process Control Block) program control block. When we callFork ()function generates a child process, the system generates atask_structstructure, then inherits some data from the parent process and inserts the new process into the process tree for process management. task_structSome state information of the process such as scheduling information, communication status of process, priority of process, some pointers of parent-child process, memory information, time slice etc.
5. Priority of the process:
Process CPU Resource allocation refers to the priority of the process. The higher priority process has the right to priority implementation. Modifying the priority of a process can greatly improve the overall performance of the system.
The priority is represented by a digital 0-139 , divided into:
Real-time Priority:1-99
Static priority:100-139
The smaller the number, the higher the priority. In order to prevent the priority of a process from being infinitely smaller, a nice value (-20---) appears, which represents the corrected value of the priority that the process can perform. The priority size of the process: the static priority +nice value, and the smaller the value, the more it is executed first.
6. Inter- process communication:
interprocess communication is the propagation or exchange of information between different processes. The user space of the process is independent of each other and is generally inaccessible to each other, with the only exception being the shared memory area. The system space is a public place, so the kernel can obviously provide such a condition.
Interprocess (IPC,interprocess communication) methods are: Pipelines, message queues, shared memory, signals, sockets, etc.
This article is from a "moment" blog, so be sure to keep this source http://zkchang.blog.51cto.com/10574636/1696888
Linux system--linux process and job management (1)