Linux process and Job management

Source: Internet
Author: User
Tags network function

1. CPU Instruction Level:

CPU Ring Level 0: Store only system-called instructions

CPU Ring Level 3: Store only user-invoked instructions


2, the operating system composition: (generalized)

Computer hardware, Kernel (operating system: System call, which can only be called by systems, comparison of the underlying), library calls (library call, interface for user programming), applications.

A call is a function module, such as a function, a class, an object, that will be loaded into a pre-compiled set of others.


3, CPU Mode classification:

User mode: Also called user space

Kernel mode: Also known as kernel space

Mode switching: Switch between user mode and kernel mode.


4. Application execution Process:

According to the compiled application from top to bottom execution, when it comes to the kernel call, it is called by the kernel execution, after the completion of the execution, return the results to the user program, and then the user program continues to execute until the program execution is complete.


5. Kernel function:

Process management: One of the important functions is process scheduling

File System Management:

Network function Management

Memory management

Driver Management

Security Function Management


6, Process priority:

Processes: Process, a copy of the running program (a program can be executed multiple times, many people can simultaneously), a program run may only run a part of the code, such as: ls,ls-l;

A process is a program in the execution of dynamic processes, the thread is when the program in order to better run, it may be divided into a number of small programs to run, these processes are part of the process is executed separately is a thread.

More than one program executes simultaneously, CPU resources are used, and CPU resources are provided to different programs in the form of time shards.

Then, when the process runs, such as 5 seconds, it switches to other processes, requiring the CPU register to hold the intermediate state.


7, the characteristics of the process:

The process has a life cycle.

Saves a process where the state is running, known as the Save site.

Task struct: The fixed format of the kernel storage process. (linked list, circular link list)

Task: The process becomes a task after it is run.

A linked list of task structs for multiple tasks is called a task list


8. Process creation:

The kernel creates the first process: init; The subsequent user's process management is implemented by INIT.

Process features:

Parent-Child process: The process is created by its parent process, destroyed, and the kernel calls the interface (Fock (), Clone ()), allowing child processes to be created.

The memory space that the parent process points to, and also the memory space that the child process points to.

Cow: Write-time replication mechanism, which refers to the parent process and the child process shared a memory space, when the child process has no write operation, the memory space has been shared, but when the child process needs to write operations, the parent process to retain the old data, the parent process will create a memory space for the child process, this is a write-time copy.


9, Process priority:

0-139:

1-99: Real-time priority, the greater the number, the higher the priority level

100-139: Static priority, the smaller the number, the higher the priority level

Process Nice value:

Refers to the static priority, reducing the priority level

Value range: -20,19;-20 for use with 100,19 139


Big O: Measure how complex a program is:

O (1): Data volume increases, complexity increases, resolution time is constant.

O (log n):

O (n): linear complexity, increased data volume, increased complexity

O (n^2):

O (2^n):


11. Process Queue Priority:

Run queue, expiration queue, each 140 priority queue; When the process in the running queue finishes running, the expiration queue becomes the desired run queue, and the run queue becomes an expired queue and continues.



12. Process task struct structure:


13. Process Memory:

Page frame, which stores page data and stores the data in a fragment in memory.

Memory linear Address: each memory thinks that it has exclusive memory of all the space

Physical Address of Memory:

Virtual Memory Implementation Mechanism:

Mmu:memory Management unit in CPU, memory management unit


Ipc:inter process Communication, interprocess communication mechanism

On the same host:

Singal

Shm:shared Memory

Semerphor

On different hosts:

Rpc:remote process Call, procedure invocation

Socket


14:linux kernel: Preemptive, multi-task execution




























Linux process and Job management

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.