Murach's Java SE 6
How to work with threads

This chapter shows how to create a program that uses multiple threads to alternate between tasks so it can run more efficiently.

Chapter 14 How to work with threads
An introduction to threads 438
How threads work 438
Typical uses for threads 438
Classes and interfaces for working with threads 440
The life cycle of a thread 442
How to create threads 444
Constructors and methods of the Thread class 444
How to create a thread by extending the Thread class 446
How to create a thread by implementing the Runnable interface 448
How to manipulate threads 450
How to put a thread to sleep 450
How to set a thread's priority 452
How to interrupt a thread 454
How to synchronize threads 456
How to create synchronized threads 456

How to use the wait and notifyAll methods to communicate among threads

458
The Order Queue application 460
The operation of the Order Queue application 460

The classes used by the Order Queue application

462
The code for the OrderQueueApp class 464
The code for the Order class 464
The code for the OrderTaker class 466
The code for the OrderHandler class 468
The code for the OrderQueue class 468




Murach's Java SE 6

Learn more about this book

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.