Java Threads

by
Edition: 3rd
Format: Paperback
Pub. Date: 2004-09-01
Publisher(s): Oreilly & Associates Inc
List Price: $39.95

Buy New

Usually Ships in 2-3 Business Days.
$39.55

Rent Book

Select for Price
There was a problem. Please try again later.

Rent Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$38.39
*To support the delivery of the digital material to you, a digital delivery fee of $3.99 will be charged on each digital item.
$38.39*

Used Book

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Threads are what allow a computer program to appear to be doing two or more things at the same time. They aren't really, but they do tasks so quickly that they appear to be. Any program written in Java has to make use of threads, but understanding how they work, and what to do when they don't work, is not simple stuff, even for experienced programmers. Java Threads is a thorough tutorial on using threads in Java. Covering everything from the basics of creating threads, through synchronization and conditions, handling deadlocks, thread lifecycles, and thread management, this is an essential book that supplements knowledge of basic functionality with in-depth, practical exploration of advanced issues.

Author Biography

Scott Oaks is a Java Technologist at Sun Microsystems, where he has worked since 1987. While at Sun, he has specialized in many disparate technologies, from the SunOS kernel to network programming and RPCs. Since 1995, he's focused primarily on Java and bringing Java technology to end-users. Scott also authored O'Reilly's Java Security, Java Threads and Jini in a Nutshell titles.

Henry Wong is an independent consultant, involved in various Java related projects. Henry previously worked as a computer engineer at Sun Microsystems from 1989 to 2003. Originally hired as a consultant to help customers with special device drivers, kernel modifications, and DOS interoperability products, Henry has also worked on Solaris ports, performance tuning projects, and multithreaded design and implementations for benchmarks and demos. Since early 1995, Henry has been involved in developing Java prototypes and supporting customers who are using Java.

Prior to working at Sun, Henry earned a Bachelor of Science degree in chemical engineering from The Cooper Union in 1987. He joined a small software company in 1986 working on SCSI device drivers, image and audio data compression, and graphics tools used for a medical information system.

When not in front of a computer, Henry is an instrument rated private pilot, who also likes to dabble in archery, cooking, and traveling to different places with his wife, Nini.

Table of Contents

Preface ix
Introduction to Threads
1(10)
Java Terms
2(2)
About the Examples
4(2)
Why Threads?
6(5)
Thread Creation and Management
11(27)
What Is a Thread?
11(3)
Creating a Thread
14(9)
The Lifecycle of a Thread
23(4)
Two Approaches to Stopping a Thread
27(4)
The Runnable Interface
31(4)
Threads and Objects
35(3)
Data Synchronization
38(30)
The Synchronized Keyword
38(3)
The Volatile Keyword
41(3)
More on Race Conditions
44(6)
Explicit Locking
50(3)
Lock Scope
53(2)
Choosing a Locking Mechanism
55(2)
Nested Locks
57(2)
Deadlock
59(6)
Lock Fairness
65(3)
Thread Notification
68(13)
Wait and Notify
68(8)
Condition Variables
76(5)
Minimal Synchronization Techniques
81(29)
Can You Avoid Synchronization?
81(5)
Atomic Variables
86(20)
Thread Local Variables
106(4)
Advanced Synchronization Topics
110(33)
Synchronization Terms
110(2)
Synchronization Classes Added in J2SE 5.0
112(6)
Preventing Deadlock
118(6)
Deadlock Detection
124(14)
Lock Starvation
138(5)
Threads and Swing
143(9)
Swing Threading Restrictions
143(1)
Processing on the Event-Dispatching Thread
144(1)
Using invokeLater() and invokeAndWait()
145(2)
Long-Running Event Callbacks
147(5)
Threads and Collection Classes
152(16)
Overview of Collection Classes
152(5)
Synchronization and Collection Classes
157(6)
The Producer/Consumer Pattern
163(3)
Using the Collection Classes
166(2)
Thread Scheduling
168(17)
An Overview of Thread Scheduling
169(7)
Scheduling with Thread Priorities
176(2)
Popular Threading Implementations
178(7)
Thread Pools
185(16)
Why Thread Pools?
185(3)
Executors
188(2)
Using a Thread Pool
190(1)
Queues and Sizes
191(4)
Thread Creation
195(1)
Callable Tasks and Future Results
196(2)
Single-Threaded Access
198(3)
Task Scheduling
201(19)
Overview of Task Scheduling
201(2)
The java.util.Timer Class
203(6)
The javax.swing.Timer Class
209(3)
The ScheduledThreadPoolExecutor Class
212(8)
Threads and I/O
220(25)
A Traditional I/O Server
221(10)
A New I/O Server
231(9)
Interrupted I/O
240(5)
Miscellaneous Thread Topics
245(15)
Thread Groups
245(2)
Threads and Java Security
247(2)
Daemon Threads
249(1)
Threads and Class Loading
250(2)
Threads and Exception Handling
252(3)
Threads, Stacks, and Memory Usage
255(5)
Thread Performance
260(8)
Overview of Performance
260(2)
Synchronized Collections
262(2)
Atomic Variables and Contended Synchronization
264(1)
Thread Creation and Thread Pools
265(3)
Parallelizing Loops for Multiprocessor Machines
268(41)
Parallelizing a Single-Threaded Program
269(26)
Multiprocessor Scaling
295(14)
Appendix: Superseded Threading Utilities 309(20)
Index 329

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.