Hi, I wanted to say great videos, simple and clear explanation. a question if lock_guard do the lock and unlock automatically within the scope what would happen if in that scope we don't want some variables to be locked or unlocked (for non-shared data)?
You could create a scope within the function. e.g. void do_something(){ int unprotected; { // critical section here is protected in this block-scope std::lock_guard lock(some_mutex); } }
C++ does not have 'finally' officially. There may be extensions (learn.microsoft.com/en-us/cpp/cpp/try-finally-statement?view=msvc-170) available in some compilers, but C++ instead uses RAII and the destructor will be called.
best series on c++ concurrent programming
Cheers, thank you for the kind words!
Thank you for explaining these concepts in such a clear way! I have watched other videos as well but yours are the best.
Cheers, you are most welcome!
Great series on C++ Concurrent ! I was wondering if you're going to make some videos on atomic operations and recursive lock.
Cheers, thank you for the kind words! I will make a note for the future!
Clear explanation! Really appreciate your efforts ✌️
Cheers!
i'm really enjoying these videos :p
Awesome!!
Hi, I wanted to say great videos, simple and clear explanation. a question if lock_guard do the lock and unlock automatically within the scope what would happen if in that scope we don't want some variables to be locked or unlocked (for non-shared data)?
You could create a scope within the function. e.g.
void do_something(){
int unprotected;
{ // critical section here is protected in this block-scope
std::lock_guard lock(some_mutex);
}
}
Nice explanation, but audio is not smooth.
Great video!
Cheers!
clicked pause button at first :D :D😅😅, Great video
Hehe 😃
Thanks for videos sir, very helpful
@@pavank2705 Cheers!
In your example you could have just unlocked the lock in a "finally" block...
C++ does not have 'finally' officially. There may be extensions (learn.microsoft.com/en-us/cpp/cpp/try-finally-statement?view=msvc-170) available in some compilers, but C++ instead uses RAII and the destructor will be called.