‹ BackHN Continuity

Thread

Book review: Is parallel programming hard, and, if so, what can you do about it?

149 points · 66 comments · ahelwer

  1. criddell · · focus · HN ↗
    This review seems to equate parallelism and concurrency as the same thing and they are not.

    As I understand it, the parallelism is about task execution and concurrency is about task structure. Or, as Rob Pike said:

    "Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once."

    He said that in his Concurrency is not Parallelism talk.

    1. ahelwer · · focus · HN ↗
      That battle has unfortunately been lost and different sources give different definitions, often exactly swapped. This was discussed in one of the HN posts linked in the article: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36318280">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36318280

      In the end I don&#x27;t think it is too much of an issue. What confusion is really brought by conflating parallelism and concurrency? Sure, concurrent programs can be serialized onto a single core (that&#x27;s how deterministic simulation testing implementations like Antithesis and record &amp; replay implementations like Mozilla&#x27;s rr operate). But there isn&#x27;t some deep conceptual unlock you get by having a strict conceptual boundary between concurrency and parallelism.

      1. Dylan16807 · · focus · HN ↗
        It&#x27;s really important to get people to recognize that concurrency can happen on a single core or a single task-switching thread. You don&#x27;t necessarily need to split off parallelism to explain that, but it helps.

        And it&#x27;s worth talking about how you can have a single task run in a parallel way, for varying strictness of &#x27;single&#x27;.

        Coroutines and SIMD are far enough apart that their execution models should have different words.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.