Atomic’s memory orders, what for? - Frank Birbacher [ACCU 2017]

Поділитися
Вставка
  • Опубліковано 4 тра 2017
  • Multithreading in C++ has been used successfully for many years prior to the introduction of C++ 11 to run programs on multi-core hardware. Then the C++ 11 Memory Model for multithreading was introduced with much debate as to its proper application. On the one hand some suggest not to bother with atomics and just use volatile if at all. On the other hand some might be happy to have everything guarded with mutexes. Either side may have been discouraged from looking deeper into the C++ 11 Memory Model, put off by its apparent complexity. The talk will focus on different options of “memory order” when using std::atomic. It’ll explain what the memory order is and what each of the options mean. We’ll take a look at the C++ memory model, sequencing of expressions and synchronization between threads. The talk sheds light on compiler optimizations and generated assembly, examines out-of-order execution in CPUs and possible cache communication between cores. In the end it should be clear what an atomic variable does apart from storing a value.

КОМЕНТАРІ • 6

  • @MichaelPims
    @MichaelPims Рік тому +2

    Despite being failed my last job interview on it, I think I would answer much better having looked at this quite clear explanation of memory ordering (hope life will give me a chance) 😊 Thank you! 👍

  • @robrick9361
    @robrick9361 6 років тому +3

    This talk is okay, I would recommend everyone go watch Herb Sutter's 2 part Atomic Weapon talk. Much better and clearer.

  • @robrick9361
    @robrick9361 6 років тому +4

    If you're going to let people ask questions GIVE THEM A MICROPHONE!

  • @arisaif
    @arisaif 4 роки тому +1

    Unfortunately, a key part of this talk about total order of sequentially consistent operations is unclear when he points to the slides, but they are not visible in the video around 1:15:37.

    • @ACCUConf
      @ACCUConf  4 роки тому

      Thanks for your comment, it appears some of the annotations are missing from the slides in this video. We have forwarded this message to the speaker, hopefully they can provide you the slides for reference.

  • @robrick9361
    @robrick9361 6 років тому

    39:06-39:42
    Both reads and writes cannot be reordered after a release/write or before an acquire/read.
    |--------------------------------------ACQUIRE-------------------------------------------|
    In between reads and writes are trapped here.
    |--------------------------------------RELEASE-------------------------------------------|