Chapter 14. Multithreading

WHAT ARE THREADS

INTERRUPTING THREADS

THREAD STATES

THREAD PROPERTIES

SYNCHRONIZATION

BLOCKING QUEUES

THREAD-SAFE COLLECTIONS

CALLABLES AND FUTURES

EXECUTORS

SYNCHRONIZERS

THREADS AND SWING

You are probably familiar with multitasking in your operating system: the ability to have more than one program working at what seems like the same time. For example, you can print while editing or downloading your email. Nowadays, you are likely to have a computer with more than one CPU, but the number of concurrently executing processes is not limited by the number of CPUs. The operating system assigns CPU time slices to each process, giving the impression of parallel activity.

Multithreaded programs extend ...

Get Core Java™, Volume I–Fundamentals, Eighth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.