Amazon Interview Question
Software Engineer / DevelopersSynchronization in Java is done using the Monitor. The idea is that when multiple threads are accessing a shared resource like a data structure, then only one thread can manipulate the contents of the resource. The rest of the threads have to wait till the thread has finished manipulation. Monitors are implemented using the objects. To enter an objects monitor, call a method that has been modified by the synchronized keyword.
Is the question about code implementation of synchronization in java or know-hows of internal implementation.
- Ibanez Guy April 21, 2008