Talk about parallelism and concurrency (multithreading)

Source: Internet
Author: User

The development trend of 1.CPU:

The number of cores will continue to grow, and, according to Moore's Law, a typical PC desktop may return to the 24 core in 2018 due to a serious bottleneck in the single core performance improvement.

2. The difference between multithreading and parallel computing:

All concurrent processing have queued, wake up and execute these three steps, so concurrency is a macro concept, on the microscopic they are all sequences are processed, but the resources will not be blocked on a certain one (usually through the time slice rotation), so on the macro multiple almost simultaneous requests are processed at the same time. If the request arrives at the same time, it will be queued for execution, depending on the priority level.

Concurrency and parallelism are two similar but not identical concepts:

Concurrency: Also known as the Common line, refers to the ability to deal with multiple simultaneous sexual activities.

Parallel: Refers to the simultaneous occurrence of two concurrent events, with the meaning of concurrency. Concurrency is not necessarily parallel, and it can be said that concurrent events do not necessarily occur at the same time.

The essence of concurrency is that a physical CPU (or multiple physical CPUs) can be multiplexed across several programs, and concurrency is forcing multi-user sharing for limited physical resources to improve efficiency.

Parallel refers to two or more two or more events or activities at the same time, in a multi-channel program environment, and the exercise of multiple programs at the same time can be executed simultaneously on different CPUs.

(* * * here to spit a bit of blog Garden Blog editor really his grandmother's rotten, extremely rotten * * * *)

Concurrency is running multiple programs on the same CPU at the same time (not really at the same time, but at the same time because the CPU is switching between multiple programs).

Parallelism is a program that runs on every CPU.

For example: Concurrency is like a person (CPU) to feed two children (programs) to eat, on the surface is two children at dinner, is actually a person feeding.

Parallel is two people to feed two children to eat.

Talk about parallelism and concurrency (multithreading)

Related Article

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.