Java
229 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Collections.synchronizedListhistorical
SynchronizedList adds synchronization around list operations. These notes cover its wrapper and source code through the need for thread safety.
- 5.24 TreeMaphistorical
TreeMap stores key-value pairs in a red-black tree with O(log N) basic operations. These notes examine key ordering and iteration.
- 5.25 Vectorhistorical
Vector is a thread-safe list with indexed access, cloning, and serialization. These notes examine usage and implementation through its class relationships.
- 5.26 fail-fasthistorical
Fail-fast stops immediately on an error, while fail-safe allows continued operation in some cases. These notes connect that distinction with collection iteration.
- HashMap in JDK 7historical
JDK 1.7 HashMap derives bucket indexes from hashes and array length, then handles collisions with linked lists. These notes trace the related methods.
- HashMap in JDK 8historical
JDK 1.8 HashMap organizes key-value data with arrays, linked lists, and red-black trees. These notes trace its implementation through access behavior and class relationships.
- 6.1 Start with the Hardwarehistorical
Understanding the Java Memory Model starts with CPU, memory, and cache relationships. These notes introduce the hardware issues through the von Neumann architecture.
- 6.2 2.Synchronizedhistorical
Synchronized protects Java synchronization blocks. These notes examine usage and implementation through atomicity, ordering, visibility, and locking overhead.
- 6.3 3.volatilehistorical
These volatile notes examine ordering, visibility, and atomicity, compare volatile with synchronized, and record usage scenarios.
- 6.4 CAShistorical
CAS can be introduced through the distinction between optimistic and pessimistic locking. These notes compare conflict handling before examining compare-and-swap.