CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced.  What do they really do?”

CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?”

CppCon

7 лет назад

223,887 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@shelvacu
@shelvacu - 01.07.2020 22:23

"It's hard to write if you don't care about occaisonal bugs; It's really hard if you do"

Ответить
@haxpor
@haxpor - 23.10.2020 23:51

For the 2nd question, memory_order_relaxed just guarantees atomic operation will be performed, but no constraint applied.

Ответить
@sumeshnb2
@sumeshnb2 - 09.03.2021 01:19

Finally, this guy made me understand memory ordering. Nice presentation...

Ответить
@z08840
@z08840 - 15.06.2021 19:44

measurably failed attempt to make a drama at the beginning - it's a different algorithms - you can't compare apples to oranges

Ответить
@assonancex
@assonancex - 19.06.2021 15:01

This talk was superb. Complex topic delivered eloquently. Thanks for that.

Ответить
@alexey104
@alexey104 - 05.07.2021 02:54

That was really interesting and useful talk, thanks a lot!

Ответить
@lkshtfl7594
@lkshtfl7594 - 15.08.2021 13:00

Thanks

Ответить
@user-cw3nb8rc9e
@user-cw3nb8rc9e - 18.08.2021 17:25

Why the designers of C++ did not made it the way, that each new thread makes a unique copy of all variables in the program, so then such problems never arise?

Ответить
@philipye7936
@philipye7936 - 09.11.2021 09:00

Really love this talk, using 1 hour watching this video is actually more efficient than reading cpp reference using a day :)

Ответить
@potter2806
@potter2806 - 04.12.2021 05:07

You let me know more detailed about the atmoic under the hood. When it comes to hardware, the optimize granularity can be really small.

Ответить
@magno5157
@magno5157 - 28.01.2022 11:00

The expression "become visible" is just awful.

What Pikus meant by "becoming visible" after an acquire barrier is simply that operations that appear after the barrier in the program are guaranteed to execute after the barrier.

Likewise, "becoming visible" before a release barrier means operations before the barrier in the program are guaranteed to have been executed by the time the barrier is reached.

A little caveat is that for the acquire barrier, operations before the barrier can be moved to execute after the barrier, but operations after the barrier in the program cannot be moved to execute before the barrier is reached. The opposite applies to release barrier.

Ответить
@notsojharedtroll23
@notsojharedtroll23 - 27.02.2022 16:02

To be really honest, with this I finally comprehended how threads are important and hence fort, a little intro to parallel computing.

Really getting into the C++ magic stuff

Ответить
@nguyendaison27
@nguyendaison27 - 04.03.2022 03:38

Thank you Mr.Fedor !

Ответить
@Astfresser
@Astfresser - 14.03.2022 10:25

I figure that atomics work a lot like git. you prepare memory in your local cache ("local repo") and release it ("pushing to a remote origin")

Ответить
@TheWarTurkey
@TheWarTurkey - 22.03.2022 01:45

Awesome talk; I've watched it several times! I have a question, though:

I understand that unsynchronized reading and writing to the same location in memory is undefined behavior. I also understand that the CPU/memory subsystem moves data in terms of cache lines. What I am still unclear on is what happens if I have two variables in my program that just so happen to be on the same cache line (e.g. two 32-bit ints), but I didn't know that: My program has two threads that each read and write from their own variable, but I, the programmer, thought it was OK because there's no (intentional) "sharing?" If these threads are non-atomically writing to their own variables, do they still have the same problem where they can "stomp" on each other's writes?

Ответить
@gubgubbubbub
@gubgubbubbub - 16.04.2022 22:05

Great presentation! That intro was great, LOL

Ответить
@2005kpboy
@2005kpboy - 20.08.2022 11:25

All these conferences on cppcon are awesome.

Ответить
@selvalooks
@selvalooks - 20.09.2022 09:02

Wonderful!!!

Ответить
@QT-yt4db
@QT-yt4db - 05.10.2022 19:53

Excellent. First time I really understand these ideas.

Ответить
@joeybluee
@joeybluee - 17.10.2022 18:05

Great talk, it's the clearest explanation I ever watched.

Ответить
@postdisc0
@postdisc0 - 15.04.2023 19:31

the most decent and clear explanation of atomics i've seen so far

Ответить
@sanjayts
@sanjayts - 28.04.2023 19:46

Would someone please know which talk he is referring to when he says "I'm not going to go into as much details as Paul did"?

Ответить
@AlexYu-nm3dg
@AlexYu-nm3dg - 11.06.2023 10:20

Great talk. I have my own benchmark but it shows: atomic > mutex > spinlock('>' means faster). Definitely my benchmark doesn't coordinate with his. Any chance I can take a look at the source code of his benchmark?

Ответить
@oraz.
@oraz. - 27.07.2023 05:15

the message I get is "use someone else's lock free queue"

Ответить
@thejezzi5219
@thejezzi5219 - 17.09.2023 13:31

What a tough crowd

Ответить
@szymoniak75
@szymoniak75 - 25.11.2023 21:40

am I the only one who is slightly confused, especially about the memory order part? everyone says this talk is great and all but I'd watched Herb Sutter talk before on atomics and I thought I somewhat understood it and now watched this and now I'm confused

Ответить
@もりけんいち-h4z
@もりけんいち-h4z - 26.12.2023 07:29

Logarithmic conference cppcon.
Thanks.

Ответить
@mohsenzare2511
@mohsenzare2511 - 27.12.2023 01:16

c++ is beautiful, and this talk is great

Ответить
@ChunyunZhe
@ChunyunZhe - 06.01.2024 03:40

How fantanstic!

Ответить
@patchouli000
@patchouli000 - 21.01.2024 03:51

"Welcome to the defense of dark art class" 🤣

Ответить
@PinganTian
@PinganTian - 27.01.2024 13:54

it really helps a lot !!!!

Ответить
@DevCurioso
@DevCurioso - 31.01.2024 02:28

Eye opening presentation, very well explained

Ответить
@BartoszZasieczny
@BartoszZasieczny - 15.02.2024 18:18

Best video explaining memory ordering ever.

Ответить
@fwang3695
@fwang3695 - 27.04.2024 17:11

future lecture should just invite some CPU architect to explain

Ответить
@blakenev10
@blakenev10 - 08.07.2024 00:09

This was an amazing talk. I’ve generally had a very loose understanding of memory ordering - enough to know I need to stay away from it. I can confidently say I finally understand it thanks to this.

Rarely will I comment on videos. This video was just too good not to. Hands down one of my favorite talks.

Ответить
@arsen1156
@arsen1156 - 01.09.2024 12:55

Good talk

Ответить
@Iamine1981
@Iamine1981 - 04.01.2025 19:16

I have listened to some of Fedor’s previous talks on metaprogramming, and this lecture on atomicity in C++ is also nicely explained. Job well done and thank you very much for contributing your experience and knowledge with the community !

Ответить