Concepts between processes and threads and the benefits of multithreading

Source: Internet
Author: User

Process:

A process can be understood as a running program, and each running program is a process.

Thread:

A thread can be a subtask that runs in a process, and a process can have n threads (n <= 1).

Advantages of Multithreading:

For example, a person can finish a job for two days (one thread works for two days), then two people can finish it in one day (two threads work one). Obviously, the work efficiency doubles, below draws a picture, may look:

Of course, this is only in the broad sense of the explanation, in fact, the bottom of the CPU is a single-threaded, but if a program is multithreaded, the CPU will be very fast between different threads to switch back and forth, so that people mistakenly think it is multi-threaded.

Concepts between processes and threads and the benefits of multithreading

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.