Linux application Development-process management

Source: Internet
Author: User

Linux Application Development-process Managementa process

One component is the kernel object that the operating system uses to manage the process, and the kernel object is the place where the system uses the statistical information to hold the process.

1 each process has a parent process

2 The child process terminates, the parent process is notified and can go to the exit state of the process

3 namespaces are similar to C + + namespace

4 process Groups

Each process has a process group that has a process group number = leader PID

Process Group leader-groupleader

5 sessions Session is a collection of one or more process groups

Setsid can create session periods

6 Related conversions

2^10 = 1K
2^20 = 1M
2^30 = 1G
2^32 = 2^30 * 2^2 = 4G


Two virtual memory

The program uses only part of the physical memory and the program itself is loaded in virtual memory

Three-process features
Linux features: Multi-tasking, multi-process, high concurrency, ticks
Independent of each other, memory isolated, dependent on virtual memory

Four-process scheduling
Fragmentation of process run time (very short interval, microseconds)
Five Process life cycle
Android: Foreground visible service background empty
Linux: Run hangs extinct

Five corresponding concepts

The zombie process is reclaimed by init (System largest process 0 boot 1 init 2 kernel thread daemon This 3 is the core process) process


process tree: init->
Process Management Calls
Process table
Process creation and destruction

Process switching


Seven creating a process
Copy parent Process
Create a new process

Eight corresponding functions
Getpid ()
Getppid ()
System ()
Fork creates the contents of the parent process copy of the child process, but the address differs from the process
Exit () clears the cache when exiting
_exit () does not clear the cache
Wait
Waitpid
Sleep

Linux application Development-process 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.