01Chapter 1: Threads in Java: Running Code ConcurrentlyA thread is a path of execution inside a program. Every Java program starts with one thread, called the main thread. You can start more threads so that several tasks run at the same time. Running tasks at the same time is called concurrency.2 min read
02Chapter 2: Synchronized MethodsThe last chapter showed that count++ can lose updates when two threads run it at once. This chapter covers four tools that fix that problem.1 min read
03Chapter 3: Deadlock and How Lock Ordering Prevents ItA deadlock happens when two threads each hold a lock and wait for the other's lock. Neither thread can move on, so both stop forever. In the diagram below, Thread 1 holds lock A and wants lock B, while Thread 2 holds lock B and wants lock A.2 min read