Soft test-----process, thread, tube, program

Source: Internet
Author: User




First, the process

1 , what is a process

A process is a running program entity and includes all of the system resources that are occupied by the running program, such as CPU (register), IO, memory, network resources, and so on. For example, the same program, which is run two times at the same time, is two separate processes.

A process is a single execution of a program that can be executed concurrently with other processes.

2 , why the process is introduced

When the program executes concurrently, it is necessary to share the resources of the system, which leads to the closure of the programs which have been lost in sequence during the execution of each program.

in order to improve the efficiency of computer systems. Enhance the parallel operation capability of various hardware in the computer system. The operating system requires that the program structure must accommodate the need for concurrent processing. The concept of a process is introduced for this purpose.

In order to better describe the concurrent execution of the program, implement the concurrency and sharing of the operating system, introduce the concept of "process".


Second, the tube process

Use PV the mechanism of operation and semaphore solves the problem of synchronous description of the process, and the large amount of synchronous operation of single semaphore is not easy to manage in each process and can cause the system to generate deadlock.

The concept of pipe process is introduced for this purpose. Enhancement is to keep all of the processes in sync with one resource, concentrating all the resources together to form a so-called secretarial process. To access the critical resources of the process, you need to report to the Secretary, the Secretary to achieve the process of the same critical resources mutually exclusive use. Ensures the security of the process for resource use.

Enhancement is a collection of data that is shared by a set of operations that can be performed on the shared data for concurrent processes. The initial code and access rights are composed.


Third, thread

A thread is an entity in a process and is the basic unit that is allocated and dispatched independently by the system.

A process has an independent unit of resources that can be independently dispatched and assigned to the basic unit. Because of the process in the creation, revocation and switching, the system must pay a large time and space overhead, so the number of processes in the system should not be too much, process switching frequency should not be too high, so that the acquaintance of the increase in the degree of concurrency. After the introduction of the thread, the independent unit with the resource can be separated from the basic unit which can be dispatched and allocated independently, the thread as the basic unit of dispatch and allocation, and the process is the units of allocating resources independently.

Feel yourself now just understand some of the more superficial things, through the next repeated, deepen understanding.

Soft test-----process, thread, tube, program

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.