Programs, processes, threads (supplement required)

Source: Internet
Author: User

1. Programs, processes, threads

  • Program: A set of instructions that complete a particular task when the program is completed.
  • Process: A process is a program with a certain independent function on a data set on a running activity, a process is a system for resource allocation and scheduling of an independent unit.
  • Thread: A thread is an entity of a process that is the basic unit of CPU dispatch and dispatch, which is a smaller unit that can run independently than a process. The thread itself basically does not own the system resources, only has a point in the operation of the necessary resources (such as program counters, a set of registers and stacks), However, it can share all of the resources owned by the process with other threads that belong to one process. One thread can create and revoke another thread, and can execute concurrently between multiple threads in the same process.

2. Differences and Exercises

A process is a specific application in which a thread is a branch of a process that exists to complete a single item or set of functions in a program.
An application can have one or more processes, a process can have one or more threads, one of which is the main thread (the thread is the entity in the process, and a thread must have a parent process).

Programs, processes, threads (supplement required)

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.