Threads and Executors
- Threads. A thread is an independent line of execution: the JVM runs many at once across cores.
- Executors. An ExecutorService owns a pool of threads and runs submitted tasks: never hand-spawn threads in application code.
- Virtual threads. Virtual threads are cheap JVM-managed threads by the million: blocking code that scales like async.
Modern Concurrent Java
- Concurrent collections. ConcurrentHashMap and friends handle locking internally: shared maps without hand-rolled synchronisation.
- CompletableFuture. A CompletableFuture composes async steps: thenApply, thenCombine: pipelines instead of callback nests.
- Immutability wins. The strongest concurrency tool is immutable data: what cannot change cannot race.
Before and after this level
- Before: Level 7: Files & I/O: Files and Streams, NIO, Serialisation and Data Handling.
- Next: Level 9: JVM & Memory: Heap, Stack and Object Allocation, Garbage Collection, JVM Runtime Behaviour.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Java Level 8: Concurrency cover?
Threads and Executors, Synchronisation and Shared State, Modern Concurrent Java: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 7: Files & I/O, which covers Files and Streams, NIO, Serialisation and Data Handling.