What Volatile Means (and Doesn’t Mean) in C++ Programming - Ben Saks - CppCon 2024

  Рет қаралды 4,360

CppCon

CppCon

Күн бұрын

Пікірлер: 30
@kimicochiang
@kimicochiang Күн бұрын
Thanks! I really appreciated Ben and Dan who gave us opportunities to deep dive into c and c++.
@LS-cb7lg
@LS-cb7lg 2 сағат бұрын
Great talk. good thing i knew most of it already, but a great refresher nonetheless :) the workaround with the opaque functions is a good thing to keep in mind!
@japedr
@japedr Күн бұрын
To be fair, I believe one of the mistakes of C and C++ is that the value and not the address is what is declared volatile, where it only makes sense in practice is when it's under a pointer/reference. I believe a much more cleaner solution would be having special functions like "volatile_read" and "volatile_write" that modify volatile memory locations. That would even allow adding non-volatile read and writes mixed in where needed; or even hardware-specific functions with their own particular set of guarantees (e.g. "semi-volatile").
@sanjaygatne1424
@sanjaygatne1424 Күн бұрын
नीट समजावून सांगितले. होलाटाइल बद्दलच्या शंका दुर झाल्या. धन्यवाद.
@xorbe2
@xorbe2 Күн бұрын
primer at 0:36 volatile at 20:29 summary at 44:05 audience questions at 46:40
@milasudril
@milasudril 2 күн бұрын
Can the language be made more expressive in order to prevent compiler bugs related to volatile?
@Fardin.Alizadeh
@Fardin.Alizadeh Күн бұрын
you are more Peter Gregory that Peter Gregory itself =))))
@jefffriedman6942
@jefffriedman6942 2 күн бұрын
it shouldn't take an hour to learn what volatile is. this is a core problem with c++ and the people surrounding it. 1 hour presentations in a world that had already been dominated by 140 characters over a decade ago.
@ZeroPlayerGame
@ZeroPlayerGame 2 күн бұрын
have you watched the talk or just read the title and looked at runtime
@srnissen_
@srnissen_ 2 күн бұрын
Explaining how to use it takes a second if you're not touching hardware ("don't"), one sentence if you're doing C++ ("The standard says it does the same as C"), and one (different) sentence if you're doing C ("Ask your hardware provider.") I would be wildly surprised to learn that it's any different for Zig or Rust. "What it is" can take arbitrarily long, depending on how long of a history lesson you want.
@ShtrikeBirb
@ShtrikeBirb 2 күн бұрын
So true
@juliovata9194
@juliovata9194 Күн бұрын
@@jefffriedman6942 it’s a feature adopted from C…
@japedr
@japedr Күн бұрын
Within 140 characters: Just use volatile for memory mapped hardware registers as the compiler would generate wrong code otherwise. Do not use it for other purposes. For the longer explanation, watch the talk. I mean, I agree that often C++ is overly complicated, but this particular issue affects all low-level languages with an optimizing compiler (like pure C, Rust, Zig or even Ada). The only way to avoid this problem is to write the assembly code yourself.
Message Handling with Boolean Algebra - Ben Deane - CppCon 2024
1:01:03
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 10 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 2 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 25 МЛН
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 32 МЛН
The Quest To Make Unbreakable Glass
22:23
Veritasium
Рет қаралды 148 М.
[SEI' 24] Modern Systems Programming: Rust and Zig - Aleksey Kladov
55:18
CeSIUM - Centro de Estudantes de Engenharia Informática da Universidade do Minho
Рет қаралды 2,4 М.
C++ Weekly - Ep 454 - std::apply vs std::invoke (and how they work!)
13:12
C++ Weekly With Jason Turner
Рет қаралды 7 М.
What Makes A Great Developer
27:12
ThePrimeTime
Рет қаралды 208 М.
How on Earth does ^.?$|^(..+?)\1+$ produce primes?
18:37
Stand-up Maths
Рет қаралды 384 М.
The Vim Experience
45:19
Bog
Рет қаралды 181 М.
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 14 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 10 МЛН