Compare and Swap in Java
Compare and swap is an alternative to Java synchronized blocks when designing concurrent data structures or algorithms. A compare and swap operation first compares the value of a variable with an expected value, and if the values are equal, swaps the value of the variable with a new value. Compare and swap is abbreviated CAS. A compare and swap operation is atomic.
Compare and swap is especially useful for check-then-act type code. You can use compare and swap operations to guard a critical section, or for optimisticl locking style concurrency.
Chapters:
0:00 Compare and swap introduction
0:31 Compare and swap example
1:45 Compare and swap for check-then-act cases
5:45 Compare and swap used in a lock implementation
9:32 Compare and swap vs. Java synchronized blocks
17:59 Compare and swap as guard for critical section
18:59 Compare and swap for optimistic locking
Compare and swap tutorial - text:
http://tutorials.jenkov.com/java-concurrency/compare-and-swap.html
Java Concurrency tutorial - text / video:
http://tutorials.jenkov.com/java-concurrency/index.html
https://www.youtube.com/playlist?list=PLL8woMHwr36EDxjUoCzboZjedsnhLP1j4
Видео Compare and Swap in Java канала Jakob Jenkov
Compare and swap is especially useful for check-then-act type code. You can use compare and swap operations to guard a critical section, or for optimisticl locking style concurrency.
Chapters:
0:00 Compare and swap introduction
0:31 Compare and swap example
1:45 Compare and swap for check-then-act cases
5:45 Compare and swap used in a lock implementation
9:32 Compare and swap vs. Java synchronized blocks
17:59 Compare and swap as guard for critical section
18:59 Compare and swap for optimistic locking
Compare and swap tutorial - text:
http://tutorials.jenkov.com/java-concurrency/compare-and-swap.html
Java Concurrency tutorial - text / video:
http://tutorials.jenkov.com/java-concurrency/index.html
https://www.youtube.com/playlist?list=PLL8woMHwr36EDxjUoCzboZjedsnhLP1j4
Видео Compare and Swap in Java канала Jakob Jenkov
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Concurrency vs ParallelismThe Java Memory Model - The BasicsRace Conditions in Java MultithreadingExperienced C++ Developers Tell the Truth in 2021Java - Compare the Objects using equals() & hashCode()Java String Comparison Tutorial (Equals vs == in Java)Bubble Sort Algorithm Tutorial in Java - How Fast Is It?For Each Loop Java Tutorial - How to Make a For Each Loop in Javak-mer algorithms: Compare and SwapJava Happens Before Guarantee - Java Memory Model - Part 2Garbage Collection in Java | What is GC and How it Works in JAVA | Part OneComparable VS Comparator || Comparable and Comparator [Most Asked Interview Question]$500 vs $16 Steak Dinner: Pro Chef & Home Cook Swap Ingredients | EpicuriousInterview Question | Comparable vs Comparator in JavaProducer Consumer Pattern - With Java ExampleUsing volatile vs AtomicInteger in Java concurrency17. Synchronization Without Locks7 + 2 Things I Love About Java