Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Concurrency_V1 (Synchronized_Block (concept (reentrancy (Thread tries…
Java Concurrency_V1
Synchronized_Block
-
-
concept
-
reentrancy
Thread tries to acquire a lock held by itself, the request succeeds
-
Without reentrancy, when a subclass call a synchronized method of a super class, it could end up in a deadlock
-
-
good_design
-
acquiring and releasing locks have their own overhead, so don't make too small synchronized blocks
-
-
volatile
-
-
good_design
code that relies on volatile variable for visibility of arbitrary state is more fragile and harder to understand than code that uses locking
-
-
-
-
local_variables
concept
live on the local thread stack, so no thread synchronization required