Loading...
Loading...
Section 10 · Stage 3: Master Java
Threads, synchronisation, executors, concurrent collections and CompletableFuture, with the classic concurrency bugs and their fixes.
What threads are, why programs use them and how to start and wait for them.
See shared data go wrong with two threads and fix it with locking.
Why one thread may not see another thread's change, and the rules that guarantee it does.
Make threads wait for each other, from wait and notify to blocking queues.
More flexible tools than synchronized, and lock-free counters.
Hand tasks to a pool instead of creating threads by hand.
Thread-safe collections and why wrapping a normal collection is often not enough.
Ready-made tools to make groups of threads wait or limit how many run at once.
Run work in the background and combine results without blocking.
Deadlocks, livelocks and other bugs that only show up sometimes, and how to find and fix them.
Small programs that put threads, pools and concurrent collections to work.
These sections are ready to study now.