C++ From Scratch: std::mutex

  Рет қаралды 6,693

Nick

Nick

Күн бұрын

Пікірлер: 15
@ChrisCox-wv7oo
@ChrisCox-wv7oo Жыл бұрын
Love the video series, really appreciate it. To add a little bit more detail about lock guard, and RAII... It's not just used to keep you protected in cases where you forget to unlock the mutex... It protects you specifically when you can't unlock the mutex, like when an exception is thrown. When an exception is thrown, the destructors of local variables are guaranteed to run. So the lock guard opens the mutex on destruction. The lock guard goes out of scope when an exception is thrown, or when local scope ends naturally (function return, block scope ends, etc).
@eduardojreis
@eduardojreis 10 ай бұрын
I was very happy to land on this channel again. Your channel helped me a lot in the past with CUDA! Thanks a lot!
@engiboye9893
@engiboye9893 11 ай бұрын
This is super helpful, I especially love that you are also showing the cpp reference on the side! Coming from an engineering & python background that page is a complete mystery for me. Thanks a lot for all you do! :D
@tanishislam4953
@tanishislam4953 Жыл бұрын
great video! for the people who are confused as to why he initialized the lock_guard object inside the function instead of outside, the lock_guard object would destruct due to control going out of scope.
@ReleaseTheKraken523
@ReleaseTheKraken523 Жыл бұрын
What a wonderful human being. Your videos are great and the explanations are easy to understand.
@0xDEAD_Inside
@0xDEAD_Inside 2 жыл бұрын
Nice, thank-you! I leanerd something new today - lockguard!
@anon_y_mousse
@anon_y_mousse Жыл бұрын
Another fun exercise for anyone passively watching, implement puts() by parallelizing putc().
@loftyTHEOWNER
@loftyTHEOWNER Жыл бұрын
I'm using VS 2022. Why my std::vector my_threads; has an error on jthread saying: namespace "std" has no member "jthread" ?
@loftyTHEOWNER
@loftyTHEOWNER Жыл бұрын
Solved! You have to use C++20. Right click on your project -> Properties -> C/C++ -> Language -> C++ Language Standard -> from the dropdown menu select the "ISO C++20 Standard" option.
@semimaths
@semimaths 2 жыл бұрын
Thanks for the video. I like your approach of teaching C++ and the focus on modern features. Do you know any similar resource to learn Rust?
@NotesByNick
@NotesByNick 2 жыл бұрын
Glad you have enjoyed the video - I'm afraid I do not (I have not worked with Rust to any meaningful degree). Cheers, --Nick
@Miles-co5xm
@Miles-co5xm Жыл бұрын
​@@NotesByNick don't fear, you are a man of steel, you won't rust😂
@VoidloniXaarii
@VoidloniXaarii 4 ай бұрын
Thank you! This was very helpful
@ShubhamJha-v8r
@ShubhamJha-v8r Жыл бұрын
Nicely Explained. Keep up the good work.
@NotesByNick
@NotesByNick Жыл бұрын
Thanks, fella!
C++ From Scratch: std::atomic
10:56
Nick
Рет қаралды 11 М.
What is Mutex in C++ (Multithreading for Beginners)
12:29
CodeBeauty
Рет қаралды 49 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
C++ From Scratch: std::move
12:27
Nick
Рет қаралды 7 М.
Difference between Binary Semaphores and Mutexes
6:04
CodeVault
Рет қаралды 31 М.
Concurrency in Rust - Sharing State
9:12
Let's Get Rusty
Рет қаралды 38 М.
How to write Thread Pools in C++
13:37
Zen Sepiol
Рет қаралды 10 М.
C++ From Scratch: std::span
9:50
Nick
Рет қаралды 5 М.
Mutex VS Semaphore In C++
7:17
CppNuts
Рет қаралды 25 М.
C++ From Scratch: push_back vs. emplace_back
9:40
Nick
Рет қаралды 4,6 М.
Rust: When C Code Isn't Enough
8:26
CodeAhead
Рет қаралды 180 М.