now writing complicated class
and felt that I use to much CRITICAL_SECTION
.
As far as I know there are atomic operations for some types, that are always executed without any hardware or software interrupt.
I want to check if I understand everything correctly.
- To set or get atomic value we don't need
CRITICAL_SECTION
because doing that there won't be interrupts. bool
is atomic.
So there are my statements, want to ask, if they are correct, also if they are correct, what types variables may be also set or get without CRITICAL_SECTION
?
P. S. I'm talking about getting or setting one single value per method, not two, not five, but one.
std::atomic
and friends. – PradoInterlockedIncrement
etc. See here for details. – Gleiwitz