Loading video player...
Welcome to my Channel...! In this Rust programming language tutorial, we go over Rust's atomic types, including the mysterious Ordering enum. In particular, we explore the std::sync::atomic module, and look at how its components can be used to implement concurrency primitives like mutexes. We also investigate some of the gotchas and sometimes counter-intuitive behaviors of the atomic primitives with different memory orderings, as well as strategies for testing for and debugging errors in concurrent code. β BuyMeACoffee: https://buymeacoffee.com/missgoogle Host MERN Application for FREE :- https://youtu.be/rcNQPZyjWv4 For any queries drop a mail at contact.missgoo@gmail.com Share your thoughts about this video in the comment section and if you have any doubts post it in comment section. PHP Full Playlist:-πππ https://youtube.com/playlist?list=PLWMB5IYAuU6coS9CWJONVuG_mZgysGd9d JavaScript Full Playlist:-πππ https://youtube.com/playlist?list=PLWMB5IYAuU6cDSTwKs8SUTP8rnRUSvGR2 ReactJS Full Playlist:πππ https://youtube.com/playlist?list=PLWMB5IYAuU6fWmpFofddsd2E67w_iVxYN Full-Stack MERN App Development tutorial:-πππ https://youtu.be/b-hTgkQ05Jg Creating and Hosting Full-Stack Site using React:-πππ https://youtu.be/FWPjMkKUZ2Q BluePrism Playlist:- https://youtube.com/playlist?list=PLWMB5IYAuU6fwXy7lFh627J9buCMnPgRU 0:00:00 Introduction 0:02:03 What are atomics? 0:05:26 The Memory Model 0:07:33 AtomicUsize 0:12:23 Questions so far 0:20:20 Implementing a (bad) Mutex 0:27:39 Our Mutex works! 0:33:04 Pesky thread interleavings 0:39:42 compare_exchange 0:44:54 Mitigating compare_exchange contention 0:50:43 compare_exchange_weak 0:57:02 Ordering::Relaxed 1:12:13 Ordering::Acquire/Release 1:26:00 The fetch_ methods 1:34:07 Ordering::SeqCst 2:00:08 Breather 2:00:40 ThreadSanitizer 2:05:49 loom 2:22:09 Atomic fences 2:27:27 volatile 2:32:18 AtomicPtr 2:35:13 Atomics through FFI 2:36:44 Consume ordering? 2:38:08 Closing thoughts You can read more about Rust's memory model in the Rust reference at https://doc.rust-lang.org/nightly/ref... and in the C++ memory model documentation at https://en.cppreference.com/w/cpp/ato.... #Rust #Programming βββββVisit Our Channel For More Videosβββββ πΉLIKE πΉSHARE πΉSUBSCRIBE Where There is a Will There is a Way π