Skip to content

Instantly share code, notes, and snippets.

@signalpillar
Last active December 21, 2015 01:19
Show Gist options
  • Select an option

  • Save signalpillar/6226746 to your computer and use it in GitHub Desktop.

Select an option

Save signalpillar/6226746 to your computer and use it in GitHub Desktop.

Concurrency VS Parallelism

Recently, at OHUG (Odessa Haskell User Group), we have raised a question: what is the difference between Parallelism and Concurrency. And seems like I have conflated terms Multitasking and Parallelism and want here to recap for myself the difference between these popular terms

  • Parallelism - means that two or more calculations happen simultaneously

    • form haskell.org
      • The term Parallelism refers to techniques to make programs faster by performing several computations in parallel. This requires hardware with multiple processing units. In many cases the sub-computations are of the same structure, but this is not necessary. Graphic computations on a GPU are parallelism.
    • from Rob Pike presentation - Concurrency is not Parallelism (it's better)
      • Parallelism is about doing lots of things at once.
    • from StackOverFlow
      • When there is no concurrency, parallelism is deterministic.
  • Concurrency - means that two or more calculations happen within the same time frame, and there is usually some sort of dependency between them

    • form haskell.org

      • The term Concurrency refers to techniques that make program more usable. Concurrency can be implemented and is used a lot on single processing units, nonetheless it may benefit from multiple processing units with respect to speed. If an operating system is called a multi-tasking operating system, this is a synonym for supporting concurrency. If you can load multiple documents simultaneously in the tabs of your browser and you can still open menus and perform more actions, this is concurrency. If you run distributed-net computations in the background, that is concurrency.
    • from GHC Mutterings

      • concurrent is non-deterministic
      • STM, message-passing are implementations
    • from StackOverFlow

      • Concurrency is all about ensuring correct access to shared resources
    • from Rob Pike presentation - Concurrency is not Parallelism (it's better)

      • Concurrency is about dealing with lots of things at once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment