Synchronization in Java using Synchronized Keyword

preview_player
Показать описание
Synchronized keyword used in java to provide synchronization among threads.
When a thread call a synchronized method it first acquire a lock on calling object then it call that method.
Synchronized keyword allow invocation of that method only by one thread at a time.
This video will explain usage of synchronized keyword in java.
Рекомендации по теме
Комментарии
Автор

Really good example within a short time!💯

rushi
Автор

so basically the keyword synchronized creates a mutex?

stormz
Автор

convention isn't followed and that makes it confusing. All classes start with capital letters. You can't use sleep () method without interrupted exception. You can't get away with that in Notepad, but not in Eclipse

alexanderbrik
Автор

thread can excess only in run method ()

zalavadiyabrijali