Chapter 13
Threads
Objectives:
After completing the chapter, you can:
- explain the main concepts of multithreading;
- develop task classes by implementing
Runnable
interface; - create threads to run tasks using
Thread
class; - control threads using the methods of
Thread
class; - use synchronized methods or blocks to synchronize threads to avoid race conditions;
- use blocking queues to synchronize access to a queue.
Topics
- 13.1 Thread concepts
- 13.2 Creating tasks and threads
- 13.3 Class Thread
- 13.4 Race condition
- 13.5 Synchronization of threads
- 13.6 Cooperation among threads
- 13.7 Tasks
Alternative materials
- in English: H. Schildt. Java - The Complete Reference: Chapter: 11
- in Estonian: here
- in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 11