The Embedded Way - The volatile keyword in C

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

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!
@iamsuperwen
@iamsuperwen 6 жыл бұрын
please talk about the keyword const, thanks for all the nice educational videos!!
@jordantaylor2437
@jordantaylor2437 7 жыл бұрын
Excellent video, thanks!
@viktorstanchev6567
@viktorstanchev6567 7 жыл бұрын
Really well explained!
@snjkmr055
@snjkmr055 5 жыл бұрын
Just awesome..........
@mohamedel-hadidy4844
@mohamedel-hadidy4844 2 жыл бұрын
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"
@cfoch3
@cfoch3 6 жыл бұрын
Awesome, thank you.
@aliakv1364
@aliakv1364 6 жыл бұрын
Very helpfull. Thanks a lot
@MalamIbnMalam
@MalamIbnMalam 2 жыл бұрын
Is there an embedded course that Siemens has anywhere online?
@playFootball100
@playFootball100 7 жыл бұрын
Lucid. Thanks a lot.
@topGfanboy
@topGfanboy 3 жыл бұрын
So simply explained
@dragosmakovei
@dragosmakovei 4 жыл бұрын
new subscriber!
@dannyfung9936
@dannyfung9936 6 жыл бұрын
Thk you so much! Thx., pls be more vedio
@rogerthat365
@rogerthat365 4 жыл бұрын
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. */
@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.
@kenyquispecondori808
@kenyquispecondori808 3 жыл бұрын
gracias por la información
@espritgaronne9975
@espritgaronne9975 5 жыл бұрын
hum! Many Thx
@VolkansSpace
@VolkansSpace 7 жыл бұрын
hi from Turkey :) thanks for video
@Darieee
@Darieee Жыл бұрын
thanks !!
@madhavjha92
@madhavjha92 Жыл бұрын
I need to learn embedded programming from scratch.... could you please help
@shirishu.deshpande4790
@shirishu.deshpande4790 3 жыл бұрын
Looking for embedded job
@rutvijjoshi8160
@rutvijjoshi8160 4 жыл бұрын
No hesitation in hitting subscribe button
@koderkev42
@koderkev42 2 ай бұрын
2x speed
@madhavjha92
@madhavjha92 Жыл бұрын
Hi sir
How to use the volatile keyword in C?
6:48
Jacob Sorber
Рет қаралды 68 М.
The static keyword in C
4:45
Siemens Embedded
Рет қаралды 13 М.
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 19 МЛН
1❤️
00:17
Nonomen ノノメン
Рет қаралды 13 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 12 МЛН
The Most Useless Keyword in C?
10:26
Jacob Sorber
Рет қаралды 68 М.
Embedded Software Engineering Interview Questions & Answers
10:24
Greidi Ajalik
Рет қаралды 53 М.
C++ for Embedded Development
52:28
The Linux Foundation
Рет қаралды 104 М.
you need to stop using print debugging (do THIS instead)
7:07
Low Level Learning
Рет қаралды 414 М.
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 57 М.
C Question 5: What are const and volatile keywords?
10:47
Rugved V Deolekar
Рет қаралды 13 М.
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Рет қаралды 326 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 89 М.
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 588 М.
Худший продукт Apple
0:53
Rozetked
Рет қаралды 226 М.
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,2 МЛН
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 144 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 5 МЛН