No video

The Embedded Way - The volatile keyword in C

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

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!
@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"
@casalaamericana5578
@casalaamericana5578 5 жыл бұрын
Direct to "my favorites" list
@sageeuthanasia9324
@sageeuthanasia9324 Жыл бұрын
You are a real code guru 😮 Thank you!
@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!!
@MalamIbnMalam
@MalamIbnMalam 2 жыл бұрын
Is there an embedded course that Siemens has anywhere online?
@topGfanboy
@topGfanboy 3 жыл бұрын
So simply explained
@madhavjha92
@madhavjha92 Жыл бұрын
I need to learn embedded programming from scratch.... could you please help
@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. */
@jordantaylor2437
@jordantaylor2437 7 жыл бұрын
Excellent video, thanks!
@Darieee
@Darieee Жыл бұрын
thanks !!
@snjkmr055
@snjkmr055 5 жыл бұрын
Just awesome..........
@viktorstanchev6567
@viktorstanchev6567 7 жыл бұрын
Really well explained!
@aliakv1364
@aliakv1364 6 жыл бұрын
Very helpfull. Thanks a lot
@VolkansSpace
@VolkansSpace 7 жыл бұрын
hi from Turkey :) thanks for video
@cfoch3
@cfoch3 6 жыл бұрын
Awesome, thank you.
@dragosmakovei
@dragosmakovei 4 жыл бұрын
new subscriber!
@rutvijjoshi8160
@rutvijjoshi8160 4 жыл бұрын
No hesitation in hitting subscribe button
@kenyquispecondori808
@kenyquispecondori808 3 жыл бұрын
gracias por la información
@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.
@playFootball100
@playFootball100 7 жыл бұрын
Lucid. Thanks a lot.
@dannyfung9936
@dannyfung9936 6 жыл бұрын
Thk you so much! Thx., pls be more vedio
@shirishu.deshpande4790
@shirishu.deshpande4790 3 жыл бұрын
Looking for embedded job
@koderkev42
@koderkev42 4 ай бұрын
2x speed
@espritgaronne9975
@espritgaronne9975 5 жыл бұрын
hum! Many Thx
@madhavjha92
@madhavjha92 Жыл бұрын
Hi sir
How to use the volatile keyword in C?
6:48
Jacob Sorber
Рет қаралды 69 М.
Embedded Software Engineering Interview Questions & Answers
10:24
Greidi Ajalik
Рет қаралды 56 М.
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 13 МЛН
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 17 МЛН
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 57 М.
Как вставить ASM в Си (inline asm)
21:54
S0ER
Рет қаралды 20 М.
C++ for Embedded Development
52:28
The Linux Foundation
Рет қаралды 105 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 786 М.
What's the FASTEST Computer Language? C++ vs Fortran vs Cobol: E04
15:22
Jonathan Blow on Simplicity
16:08
Jonathan Blow Clips
Рет қаралды 59 М.
A const int is not a constant.
9:16
Jacob Sorber
Рет қаралды 67 М.