Source |
CodingSec |
Identifiant |
359913 |
Date de publication |
2017-04-27 13:43:37 (vue: 2017-04-27 13:43:37) |
Titre |
How do you achieve synchronization in java programming |
Texte |
The key to synchronization in Java is monitor. A monitor is an object which is used for obtaining a mutual exclusive lock. Once a thread acquires a lock, it is said to have entered the monitor. When one thread is inside the monitor, no other thread is allowed to acquire a lock until that thread exits the monitor. Every object in Java has an implicit monitor associated with it. To enter an object's monitor, a method which is modified using synchronized keyword should be called. Synchronized Methods A method that is modified with the synchronized keyword is called a synchronized method.
|
Envoyé |
Oui |
Condensat |
achieve acquire acquires allowed appeared associated called coding enter entered every exclusive exits first has have how implicit inside isâ monitor java key keyword lock method methods modified monitor mutual object obtaining once one other post programming said security should synchronization synchronized theâ synchronized thread until used usingâ synchronized when which |
Tags |
|
Stories |
|
Notes |
|
Move |
|