Concurrency vs Parallelism from StackOverflow

Source: Internet
Author: User

StackOverflow wonderful answer to organize ...
My english level slag, translation of the main purpose of self-collation deepen understanding. If it is unfortunate to mislead you, please forgive me. If you kindly remind me, you can leave a message directly below.
Original link

Concurrency is when both tasks can start, run, and complete in overlapping time periods. It doesn ' t necessarily mean they ' ll ever both is running at the same instant. Eg. Multitasking on a single-core machine.
Concurrency refers to the two tasks that can start, run, and complete within a staggered period . Does not necessarily mean that even a task is running at the same instant. For example, multi-tasking on a single-core machine.

Parallelism is when tasks literally run at the same time, eg. On a multicore processor.
Parallelism refers to multiple tasks running at the same time by literal means. For example, perform tasks on multi-core processors.

Quoting Sun ' s multithreaded Programming Guide:
Citation<<Sun‘s Multithreaded Programming Guide>>

Concurrency:a condition that exists when at least, the threads is making progress. A more generalized form of parallelism that can include time-slicing as a form of virtual parallelism.
Concurrency: exists under the following conditions: At least two threads are in progress. Concurrency is included in a more generic parallel pattern, which is interpreted as virtual parallelism with time intervals.

Parallelism:a condition that arises when at least, the threads is executing simultaneously.
Parallelism: At least two threads are executing at the same time, under such conditions.

Another explanation of comparative image:
Rob usually talks about Go and usually addresses the question of Concurrency vs Parallelism in a visual and intuitive EXPL anation! Here's a short summary:

Task:let ' s burn a pile of obsolete language manuals! One at a time!
Task: Burn out a bunch of old language reference manuals. Sequential execution:

Concurrency:there is many concurrently decompositions of the task! One example:
Concurrency: Task decomposition, concurrent execution:


Parallelism:the previous configuration occurs in parallel if there is at least 2 gophers working at the same time or not .
At least two rats can work at the same time to be counted as parallel.

Confusion exists because dictionary meanings of both these words are almost the same:
Because the meaning of concurrency and parallelism is basically the same in a dictionary, it is normal to have doubts.

Concurrent:existing, happening, or done at the same time (dictionary.com)
Parallel:very similar and often happening at the same time (Merriam Webster).
Yet the They is used in computer and programming is quite different. Here is my interpretation:
However, they are very different when used in CS. Here is my explanation:
Concurrency:interruptability
Concurrency: can be interrupted.
Parallelism:independentability
Parallelism: no interdependent relationship.
Space is limited, more explanations can be found in the original, linked to the top.

Concurrency vs Parallelism from StackOverflow

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.