Before session 14
Threads
Objectives:
When you finish this module, you will
- get an overview of multithreading;
- develop task classes by implementing the
Runnable
interface; - create threads to run tasks using the
Thread
class; - control threads using the methods of the
Thread
class; - use synchronized methods or blocks to synchronize threads to avoid race conditions;
- use blocking queues to synchronize access to a queue.
Topics
- 14.1 Thread concepts
- 14.2 Creating tasks and threads
- 14.3 The Thread class
- 14.4 Race condition
- 14.5 Thread synchronization
- 14.6 Cooperation among threads
- 14.7 Tasks
Alternative materials
- in English: H. Schildt. Java - The Complete Reference: Chapter: 11
- in Estonian: here
- in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 11