We analyze what to do when you need to work with multithreading. Synchronized is certainly a classic, but maybe there are solutions that are better in terms of performance? Alexey Konokhov, senior java engineer will consider alternatives.
Taycodes:
00:00 - Intro
00:16 - Welcome
00:20 - What is this video about?
00:24 - What do you need to know already?
00:33 - Four key points to be covered
01:08 - A couple of seconds of motivation))
01:14 - Description of the problem to be solved
01:39 - Description of the proposed solution
02:00 - Description of the interface that needs to be implemented to solve the problem
02:15 - Interface view in Java
02:46 - What is blocking
03:03 - Implementation of the TokenHolder interface for a single-threaded scenario
04:02 - Implementation of the TokenHolder interface using synchronized
04:29 - Implementation problem, using synchronized
04:59 - Implementing the TokenHolder interface using ReadWriteLock
06:03 - Can the use of read-write lock be improved?
06:12 - Implementing the TokenHolder interface using StampedLock
06:51 - Additional features provided by StampedLock
07:10 - Implementation of the TokenHolder interface using optimistic-lock
08:04 - How to test multithreaded code
09:43 - Performance testing of each implementation
11:20 - Why synchronized is better than ReadWriteLock
12:14 - Conclusions about the use of locks based on the solution of the task
13:08 - Conclusion
13:20 - Subscribe
Git link - https://github.com/LutherWest/java-co...
________
Subscribe to our social networks:
Instagram: / mjc.talks
MJC Telegram Chat: https://t.me/mjcby
Community page: https://mjc.by
Смотрите видео Synchronized vs ReadWriteLock vs StampedLock [Java Multithreading] онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MJC 16 Сентябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,367 раз и оно понравилось 185 людям.