Operating system processes

Source: Internet
Author: User

Operating system running multiple processes at the same time, how to manage and dispatch these processes to make reasonable use of system resources, improve system throughput?

Process is created by the operating system kernel, each process is allocated 4G of addressing space (in 32-bit operating system, a pointer length is 4 bytes, and 4-byte pointer is the addressing ability from 0X00000000~0XFFFFFFFF, the maximum value of 0xFFFFFFFF represents 4GB Size of the capacity, to note that this 4GB address space is "virtual", is not real, and each process can only access their own virtual address space in the data, unable to access other processes of data, through this method to achieve inter-process address isolation, the addressing space is a virtual address space, Contains the user state (0~3G) and the kernel State address space (3G-4G), the application can only execute the user-state code, only when the system calls to execute, it will enter the kernel state, the kernel State address space is shared by all processes (is the operating system kernel running place).

The user state also contains the execution code of the process, the data, heap (heap), and the user state stack, when the program executes malloc (memory allocation to the system to allocate a specified size of bytes), is actually in the virtual address space requested (dynamic memory allocation).

When the CPU executes the code, it does not use the physical address to operate the physical memory directly, but instead uses the virtual address. When the MMU (Memory Management unit) receives the virtual address from the CPU, it first goes to the Memory table (the page table, the virtual memory page to the physical memory mapping relationship), if found that the current needs of the page already exists in physical memory, then go directly to the operation, if the discovery is not there, will produce a fault (interrupt), The interrupt handler loads the corresponding page into physical memory (the LRU page substitution algorithm) and replaces the least recently used page back into virtual memory (the virtual memory is typically set to 1.5~3 times the actual physical memory).

Each process has a Process Control block (PCB), which is actually a task_struct structure that maintains the core information of the processes, such as process ID, run status, priority, and the resources of the build process. To view the process in detail, go to the/proc/pid directory and view the contents of the Maps,smaps,status three files.

Operating system processes

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.