воскресенье, 1 июля 2018 г.

Java synchronized keyword

Java multithreading has 2 key aspects - visibility and automicity.

  • For synchronization in Java one can use synchronized keyword. 
  • Keyword synchronized is not equivalent to atomic, but synchronization can be used to achieve atomicity. 
  • When subclassing a class overridden method should also define synchronized in its signature. 
  • A synchronized method can call another synchronized method on its own instance.

Комментариев нет:

Отправить комментарий