Arvid Norberg: The C++ memory model: an intuition

Sdílet
Vložit
  • čas přidán 11. 06. 2024
  • Have you ever wondered about the meaning of acquire, release, relaxed and sequentially-consistent? These are the "memory orders" in C++. In this talk I will break down and illustrate the semantics of the memory orders in the C++ memory model. I will propose a simple mental model to help reason about atomic operations, but also highlight how error prone they can be.
    StockholmCpp 0x1B,
    www.meetup.com/StockholmCpp/e...
    kindly hosted by HiQ
    www.hiq.se/
    event photos
    www.meetup.com/StockholmCpp/p...
  • Věda a technologie

Komentáře • 16

  • @qiushizheng9208
    @qiushizheng9208 Před měsícem

    best tutorial for the freshmen to learn the basic idea of memory model and memory barrier!!!

  • @alexeysubbota
    @alexeysubbota Před rokem +3

    The most useful and practical explanation I've ever seen on the Internet! Thanks for the presentation!

  • @davidli2745
    @davidli2745 Před 2 lety +4

    A very easy-to-understand lesson, thanks!

  • @atomicCache_
    @atomicCache_ Před 8 měsíci +3

    This video clarified many things, thanks 😇😇

  • @evgenyyakut2716
    @evgenyyakut2716 Před 9 měsíci +4

    I appreciate the intuitive model for atomics, though I was a bit disappointed by the speaker showing shaky understanding of the atomics, which was leaking into the presentation and some takeaways. "memory_order_relaxed is most likely a bug" is simply not true. When two threads talk to each other by means of a single atomic variable (and nothing else) it is acceptable to use memory_order_relaxed. The phrase "last resort" also didn't make sense to me. I'm assuming they meant that we should use the safest things first, optimizing as we see fit, but that wasn't clear to me at first.

  • @belalibrahim7501
    @belalibrahim7501 Před rokem +1

    Very mesmerizing illustration!

  • @quant-prep2843
    @quant-prep2843 Před rokem +2

    wow, absolutely smashed this one!! thanks a lot

  • @abhijitiitr
    @abhijitiitr Před 4 lety +4

    Good and concise talk.

  • @Quancept
    @Quancept Před 3 lety +3

    Wow! great video. Wish it was a bit longer, including the audience discussions.

  • @anna7sept
    @anna7sept Před 2 lety +4

    Herb Sutter's talk is available at czcams.com/video/A8eCGOqgvH4/video.html

  • @eyyo3571
    @eyyo3571 Před 2 lety

    What is "ready" at 9:12

    • @ShtacketT
      @ShtacketT Před 2 lety +1

      Atomic flag indicating that w was initialized.

  • @isaaclacoba4458
    @isaaclacoba4458 Před 3 lety +4

    The title is misleading as the talk is about multi-thread synchronisation and atomic variable; either way, really good video. Thanks for sharing!

  • @shunxiancai5878
    @shunxiancai5878 Před rokem

    Title should've been "memory orders"

  • @sTammoi
    @sTammoi Před 3 lety

    Kappa

  • @aerobooxt
    @aerobooxt Před 3 lety +1

    I'm learning this subject, great talk!