Section outline

  • Lesson intent: students learn how to run tasks in parallel without losing correctness, and they gain a realistic mental model of what breaks in multithreaded code: race conditions, visibility, deadlock, and misuse of shared state.

    • Micro-topic BB1-L24-MT1 — Threads and tasks: the minimum you must get right

      Goal: Students can create threads/tasks correctly, explain start() vs run(), and control basic lifecycle with join() and interruption.

    • Micro-topic BB1-L24-MT2 — Race conditions and “lost updates”

      Goal: Students can identify race conditions, explain why count++ is unsafe under concurrency, and understand visibility vs atomicity.

    • Micro-topic BB1-L24-MT3 — Synchronization, locks, and deadlock

      Goal: Students can use synchronized correctly, understand what it guarantees, and recognize deadlock risks and prevention patterns.

    • Micro-topic BB1-L24-MT4 — Executors, callables, and futures

      Goal: Students can use thread pools conceptually, submit tasks, understand futures, and shut down executors safely.

    • Micro-topic BB1-L24-MT5 — Thread-safe data: volatile, atomics, blocking queues, concurrent collections

      Goal: Students can choose the correct tool for shared data: when to use volatile, when to use atomics, when to use concurrent collections, and when to redesign for immutability.