Concurrency vs parallelism, concurrent programming vs parallel programming

Source: Internet
Author: User

ConcurrencyAndParallelismAre
NotThe same thing. Two TasksT1AndT2Are concurrent if the order in which the two tasks are executed in time is not predetermined,


  • T1May be executed and finished before
    T2,
  • T2May be executed and finished before
    T1,
  • T1AndT2May be executed simultaneously at the same instance of time (Parallelism ),
  • T1AndT2May be executed Alternatively,
  • ...


If two concurrent threads are scheduled by the OS to run on one single-core non-SMT non-CMP processor, you may get concurrency but not parallelism. parallelism is possible on multi-core, multi-processor or distributed systems.


ConcurrencyIs often referred to as a property of a program, and is a concept more general
Parallelism.


Interestingly, weCannotSay the same thing
Concurrent ProgrammingAndParallel Programming. They are overlapped, but neither is the superset of the other. The difference comes from the sets of topics the two areas cover. For example, concurrent programming between des
Topic like signal handling, while parallel programming into des topic like memory consistency model. The difference reflects the different orignal hardware and software background of the two programming practices.

[Original link: http://blogs.oracle.com/yuanlin/entry/concurrency_vs_parallelism_concurrent_programming]

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.