1. 6.2 2.Synchronizedhistorical

    1. What it is. An implementation of pessimistic locking in Java. Compared with volatile, it is a heavyweight lock and can guarantee atomicity, ordering, and visibility. 2. When to use it. 3. How to use it. 4. Principle analysis of synchronized blocks. 5. Principle analysis of synchronized methods.

  2. 6.24 Lock Optimizationhistorical

    1. JVM optimizations for locks: lock elimination, lock coarsening, biased locking, and adaptive locking. 2. Analysis of lock inflation. 3. Application-level optimization of lock usage. 4. Adjusting the number of spins.