Java Multithreading Tutorial for Beginners #8: Thread Synchronization - Why and How

preview_player
Показать описание
In this chapter, we will learn about thread synchronization. When we work on parallel execution, we will soon come to a point where data becomes inconsistent because of simultaneous access of shared resources from multiple threads.

In this video, we will see a real example of synchronization issue and will fix it using synchronization with "synchronized" keyword.

You can find the source code of this chapter in the following GitHub repository.

Website:-

#Multithreading
#GenuineCoder
#Java
Рекомендации по теме
Комментарии
Автор

one of the best videos about hava threads THANK you !!!!

tompol
Автор

Another important topic ! In fact, I'm using in a crawler project, synchronizedList to avaliable access to threads.
Crawler.fila_a_visitar = new PriorityBlockingQueue<>(taminifila, new url_comparator());
Crawler.fila_visitada = ArrayList<>());
Crawler.fila_dominio_unicos = new ConcurrentHashMap<>();

erfelipe
Автор

#GenuineCoder Sir, I have used CopyOnWriteArrayList to be passed as List instead of ArrayList, it is not giving expected output, why ?
If CopyOnWritearrayList is thread safe, it should give me the correct output without the synchronized block, explain ?

kapilbablani
visit shbcf.ru