Contents

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

image Part I: Thread APIs

image Chapter 1: Threads and Runnables

Introducing Thread and Runnable

Creating Thread and Runnable Objects

Getting and Setting Thread State

Starting a Thread

Performing More Advanced Thread Tasks

Interrupting Threads

Joining Threads

Sleeping

Summary

image Chapter 2: Synchronization

The Problems with Threads

Race Conditions

Data Races

Cached Variables

Synchronizing Access to Critical Sections

Using Synchronized Methods

Using Synchronized Blocks

Beware of Liveness Problems

Volatile and Final Variables

Summary

image Chapter 3: Waiting and Notification

Wait-and-Notify API Tour

Producers and Consumers

Summary

image Chapter 4: Additional Thread Capabilities

Thread Groups

Thread-Local Variables

Timer Framework

Timer in Depth

TimerTask in Depth

Summary

image Part II: Concurrency Utilities

image Chapter 5: Concurrency Utilities and Executors

Introducing the Concurrency Utilities

Exploring Executors

Summary

image Chapter 6: Synchronizers

Countdown Latches

Cyclic Barriers

Exchangers

Semaphores

Phasers

Summary

image Chapter 7: The Locking Framework

Lock

ReentrantLock

Condition

ReadWriteLock

ReentrantReadWriteLock

Summary

image Chapter 8: Additional Concurrency Utilities

Concurrent Collections

Using BlockingQueue and ArrayBlockingQueue

Learning More About ConcurrentHashMap

Atomic Variables

Understanding the Atomic Magic

Fork/Join Framework

Completion Services

Summary

image Part III: Appendices

image Appendix A: Answers to Exercises

Chapter 1: Threads and Runnables

Chapter 2: Synchronization

Chapter 3: Waiting and Notification

Chapter 4: Additional Thread Capabilities

Chapter 5: Concurrency Utilities and Executors

Chapter 6: Synchronizers

Chapter 7: The Locking Framework

Chapter 8: Additional Concurrency Utilities

image Appendix B: Threading in Swing

A Single-Threaded Programming Model

Threading APIs

SwingUtilities and EventQueue

SwingWorker

Timer

Timer-Based Slide Show

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.54.168