SAUSECODE

“Source code. Sauce code. Sause code. It compiled — feature, not a bug.”

Tag: mutithreading

  • ReentrantLock in Java

    ReentrantLock in Java

    The Core Architecture 1. Basic Locking & Mutual Exclusion 2. The Meaning of “Re-entrant” 3. Execution Control: Fair vs. Unfair 4. Advanced Lock Interrogation (tryLock) Concrete Example – Movie Seat Booking Let’s apply this directly to the multi-threaded movie theater booking example. Advanced Signaling with newCondition() Mutual exclusion solves the problem of writing data safely,…