The Embedded Way - The volatile keyword in C

  Рет қаралды 44,361

Siemens Embedded

Siemens Embedded

8 жыл бұрын

Пікірлер: 30
@yashesvii
@yashesvii 3 жыл бұрын
I don't know if I should say but I never thought how the volatile keyword will change the context with it's placement! This was really crazy! Thank you!
@sageeuthanasia9324
@sageeuthanasia9324 Жыл бұрын
You are a real code guru 😮 Thank you!
@casalaamericana5578
@casalaamericana5578 5 жыл бұрын
Direct to "my favorites" list
@JoseGonzalez-rt5fk
@JoseGonzalez-rt5fk 5 жыл бұрын
Fantastic; it's great explanation of C++ features that are usually shoved in the back. I love your video!
@MalamIbnMalam
@MalamIbnMalam 2 жыл бұрын
Is there an embedded course that Siemens has anywhere online?
@iamsuperwen
@iamsuperwen 6 жыл бұрын
please talk about the keyword const, thanks for all the nice educational videos!!
@mohamedel-hadidy4844
@mohamedel-hadidy4844 3 жыл бұрын
to sum it up, the volatile keyword prevents the variable from getting cached Thanks for the awesome explanation
@wew8820
@wew8820 2 жыл бұрын
no, not really from getting cached. the volatile keyword prevents the compiler from optimising away the variable and subsequent code whose access is controlled by that variable based on what value the variable has during static analysis/compilation. Consider a variable that is of type bool, and is set to 'true'. The compiler will see that and go "ok, I can just delete any code that would only be reached if this were false, because this is always going to be true". With volatile you tell the compiler "we don't know what this value will be at runtime, so don't be overly aggressive with your optimisation here, just leave it as is. the variable can change at any time during runtime, it's volatile, it's subject to change without notice"
@jordantaylor2437
@jordantaylor2437 7 жыл бұрын
Excellent video, thanks!
@viktorstanchev6567
@viktorstanchev6567 7 жыл бұрын
Really well explained!
@rogerthat365
@rogerthat365 5 жыл бұрын
Hoping my question is not stupid. //program 1 volatile int *x = new int; *x = 5; write(anybinaryfile, &x, sizeof(int*)); while(1); //program 2 volatile int *y; read(anybinaryfile, &x, sizeof(int*)); printf("%d", *y); /* should this work??? if run program 2 before shutting program 1. As when I tried to run program 2, it returned core dump. */
@aliakv1364
@aliakv1364 6 жыл бұрын
Very helpfull. Thanks a lot
@cfoch3
@cfoch3 6 жыл бұрын
Awesome, thank you.
@madhavjha92
@madhavjha92 Жыл бұрын
I need to learn embedded programming from scratch.... could you please help
@dragosmakovei
@dragosmakovei 4 жыл бұрын
new subscriber!
@snjkmr055
@snjkmr055 5 жыл бұрын
Just awesome..........
@gghhff3344
@gghhff3344 5 жыл бұрын
shared variable with another executable thread can be either global or external variable ? is am i right ? is there any more situation ? thank you so much
@EmbeddedSoftware
@EmbeddedSoftware 5 жыл бұрын
Global and external are the same thing in C. Great care is needed when sharing variables between threads, as there must be atomic access. Better to use RTOS inter-task communication facilities.
@topGfanboy
@topGfanboy 3 жыл бұрын
So simply explained
@playFootball100
@playFootball100 7 жыл бұрын
Lucid. Thanks a lot.
@shirishu.deshpande4790
@shirishu.deshpande4790 3 жыл бұрын
Looking for embedded job
@dannyfung9936
@dannyfung9936 6 жыл бұрын
Thk you so much! Thx., pls be more vedio
@VolkansSpace
@VolkansSpace 7 жыл бұрын
hi from Turkey :) thanks for video
@kenyquispecondori808
@kenyquispecondori808 3 жыл бұрын
gracias por la información
@Darieee
@Darieee Жыл бұрын
thanks !!
@espritgaronne9975
@espritgaronne9975 5 жыл бұрын
hum! Many Thx
@rutvijjoshi8160
@rutvijjoshi8160 4 жыл бұрын
No hesitation in hitting subscribe button
@koderkev42
@koderkev42 3 ай бұрын
2x speed
@madhavjha92
@madhavjha92 Жыл бұрын
Hi sir
How to use the volatile keyword in C?
6:48
Jacob Sorber
Рет қаралды 68 М.
why do void* pointers even exist?
8:17
Low Level Learning
Рет қаралды 338 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 16 МЛН
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 157 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 22 МЛН
Becoming an embedded software developer
4:58
Siemens Embedded
Рет қаралды 41 М.
Scientific Concepts You're Taught in School Which are Actually Wrong
14:36
The static keyword in C
4:45
Siemens Embedded
Рет қаралды 13 М.
The mind behind Linux | Linus Torvalds | TED
21:31
TED
Рет қаралды 6 МЛН
A const int is not a constant.
9:16
Jacob Sorber
Рет қаралды 66 М.
C++ for Embedded Development
52:28
The Linux Foundation
Рет қаралды 104 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 118 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Assembly Language in 100 Seconds
2:44
Fireship
Рет қаралды 1,5 МЛН
But, what is Virtual Memory?
20:11
Tech With Nikola
Рет қаралды 236 М.
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41
ÉЖИ АКСЁНОВ
Рет қаралды 1,1 МЛН
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 720 М.
Это Xiaomi Su7 Max 🤯 #xiaomi #su7max
1:01
Tynalieff Shorts
Рет қаралды 1,1 МЛН
EXEED VX 2024: Не өзгерді?
9:06
Oljas Oqas
Рет қаралды 46 М.