Organization of This Book

Here’s an outline of the book, showing the progression of the material we present. The material in the appendixes is generally either too immature to present fully or is mostly of academic interest, although it may be useful in rare cases.

Chapter 1

This chapter introduces the concept of threads and the terms we use in the book.

Chapter 2

This chapter introduces the Java API that allows the programmer to create threads.

Chapter 3

This chapter introduces the simple locking mechanism that Java developers can use to synchronize access to data and code.

Chapter 4

This chapter introduces the other Java mechanism that developers use to synchronize access to data and code.

Chapter 5

This chapter summarizes the techniques presented in the previous chapters. Unlike the earlier chapters, this chapter is solutions oriented: the examples give you an idea of how to put together the basic threading techniques that have been presented so far, and provide some insight into designing effectively using threads.

Chapter 6

This chapter introduces the Java API that controls how threads are scheduled by the virtual machine, including a discussion of scheduling differences between different implementations of the virtual machine.

Chapter 7

This chapter provides examples that extend Java’s scheduling model, including techniques to provide round-robin scheduling and thread pooling.

Chapter 8

This chapter discusses various advanced topics related to data synchronization, including designing around deadlock and developing some additional synchronization classes, including synchronization methods from other platforms that are not directly available in Java.

Chapter 9

This chapter discusses how to design your program to take advantage of a machine with multiple processors.

Chapter 10

This chapter discusses Java’s ThreadGroup class, which allows a developer to control and manipulate groups of threads. Java’s security mechanism for threads is based on this class and is also discussed in this chapter.

Appendix A

This appendix presents a few methods of the Java API that are of limited interest: methods that deal with the thread’s stack and the ThreadDeath class.

Appendix B

This appendix presents the details of the exceptions and errors that are used by the threading system.

Get Java Threads, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.