- atomicity
Synchronized blocks help realize atomicity, but their data operations cannot be atomic. To make stuff in a synchronous block atom, you often use atomic data structures like getters and setters like AtomicBoolean.
There is a cornucopia of large atomic classes, such as int atomic arrays, supported by the latest version of java.
- how interrupts are handled:
Interrupts are clearly not handled by synchronization - synchronous ones only block gaurantee, which, when executed, cannot be re-entered by another thread.
jayunit100
source share