Java Thread Programming

ISBN-10: 0672315858

ISBN-13: 9780672315855

Edition: 1999

Authors: Paul Hyde

List price: $39.99
30 day, 100% satisfaction guarantee

If an item you ordered from TextbookRush does not meet your expectations due to an error on our part, simply fill out a return request and then return it by mail within 30 days of ordering it for a full refund of item cost.

Learn more about our returns policy


Threads are part of a programme that allows the operating system to perform tasks simultaneously, thus making applications faster and more efficient. This book offers a guide to threads, which are notoriously difficult to programme.
what's this?
Rush Rewards U
Members Receive:
You have reached 400 XP and carrot coins. That is the daily max!
Study Briefs

Limited time offer: Get the first one free! (?)

All the information you need in one place! Each Study Brief is a summary of one specific subject; facts, figures, and explanations to help you learn faster.

Add to cart
Study Briefs
Calculus 1 Online content $4.95 $1.99
Add to cart
Study Briefs
SQL Online content $4.95 $1.99
Add to cart
Study Briefs
MS Excel® 2010 Online content $4.95 $1.99
Add to cart
Study Briefs
MS Word® 2010 Online content $4.95 $1.99
Customers also bought

Book details

List price: $39.99
Copyright year: 1999
Publisher: Pearson Education
Publication date: 8/20/1999
Binding: Paperback
Pages: 528
Size: 7.50" wide x 9.25" long x 1.25" tall
Weight: 1.936
Language: English

Introduction to Threads
What Is a Thread?
Why Use Multiple Threads?
When Multiple Threads Might Not Be Good
Java's Built-in Thread Support
Basy to Start, Tough to Master
A Simple Two-Thread Example
Extending the java.lang.Thread Class
Overriding the run() Method
Spawning a New Thread
Putting It All Together
Crealing and Starting a Thread
Using Thread.currentThread()
Naming a Thread: getName() and setName()
Thread Constructors
Enlivening a Thread: start() and isAlive()
Using Thread.sleep()
Implementing Runnable Versus Extending Thread
Visual Timer Graphical Component
Extending Thread and JComponent?
Interface java.lang.Runnable
Passing a Runnable Object to a Thread's Constructor
Modifying SecondCounter to Use Runnable
Checking the Accuracy of SecondCounter
Improving the Accuracy of SecondCounter
Gracefully Stopping Threads
Interrupting a Thread: interrupt()
Suspending and Resuming Thread Execution
Stopping a Thread
The Best Replacement for stop(), suspend(), and resume()
Daemon Threads
Thread Prioritization
System Thread Priorities
Thread Priority Constants
Determining the Current Priority: getPriority()
Changing the Priority of a Thread: setPriority()
Thread States
Priorities and Scheduling
Voluntarily Relinquishing the Processor: Thread.yield()
Thread-Scheduling Scenarios
Concurrent Access to Objects and Variables
Volatile Member Variable Modifier
Synchronized Method Modifier
Synchronized Statement Block
Static synchronized Methods
Using the Class-Level Lock in a synchronized Statement
Synchronization and the Collections API
Speeding Concurrent Access
Inter-thread Communication
The Need for Inter-thread Signaling
The Wait/Notify Mechanism
Object API Used for Wait/Notify
When to Use notify All() Instead of notify()
Missed Notification
Early Notification
CubbyHole Example
Using join() to Wait for a Thread to Die
Streaming Data Between Threads Using Pipes
Using ThreadLocal and Inheritable ThreadLocal
Threads and Swing
Why Isn't the Swing Toolkit Multithread-Safe?
Using Swing Utilities.invokeAndWait()
Using Swing Utilities.invokeLater()
Using SwingUtilities.isEventDispatch Thread()
When invokeAndWait() and invokeLater() Are Not Needed
The Need for Worker Threads in a GUI Setting
Using a Worker Thread to Relieve the Event Thread
Scrolling Text in a Custom Component
Animating a Set of Images
Displaying Elapsed Time on a JLabel
Floating Components Around Inside a Container
Thread Groups
What Are Thread Groups?
Using getParent()
Finding the Subgroups of a Thread Group
Using the getThreadGroup() Method of Thread
Finding All the Threads in a Thread Group
Understanding Thread Group Security
Using setMaxPriority() and getMaxPriority()
Using interrupt()
Deprecated Methods: stop(), suspend(), and resume()
Class ThreadViewer
Self-Running Objects
Simple Self-Running Class
Using an Inner Class to Hide run()
Additional Functionality to Consider
Exception Callback
ExceptionListener Interface
Additional Methods to Support ExceptionListener
Thread Pooling
Benefits of Thread Pooling
Considerations and Costs of Thread Pooling
A Generic Thread Pool: ThreadPool
A Specialized Worker Thread Pool: HttpServer
Waiting for the Full Timeout
Accidentally Returning Early
Determining If wait() Should Be Invoked Again
A General-Purpose Wait-Until Pattern
Breaking Out of a Blocked I/O State
The read() Method Ignores Interrupts and Stop Requests
Closing a Stream to Break Out of the Blocked State
Throwing InterruptedIOException When Interrupted
Using BufferedThreadedInputStream for Interruptible I/O
The SureStop Utility
Guidelines for Using SureStop
The SureStop Class
Peering Inside Using SureStop Verbose
Watching It Work with SureStopDemo
The BooleanLock Utility
BooleanLock Class
Inter-Thread Signaling Using BooleanLock
Avoiding Blocking on synchronized
Noticing Brief Changes in Value Using TransitionDetector
First-In-First-Out (FIFO) Queue
How a FIFO Queue Works
Implementing a FIFO with an Array
Simple Implementation in Java: SimpleObjectFIFO
An Expanded FIFO Queue for Object References: ObjectFIFO
A FIFO Queue for Bytes: ByteFIFO
The Thread API
Member Variables
Static methods
Instance Methods
Deprecated Methods
The ThreadGroup API
Instance Methods
Deprecated Methods
Free shipping on orders over $35*

*A minimum purchase of $35 is required. Shipping is provided via FedEx SmartPost® and FedEx Express Saver®. Average delivery time is 1 – 5 business days, but is not guaranteed in that timeframe. Also allow 1 - 2 days for processing. Free shipping is eligible only in the continental United States and excludes Hawaii, Alaska and Puerto Rico. FedEx service marks used by permission."Marketplace" orders are not eligible for free or discounted shipping.

Learn more about the TextbookRush Marketplace.