Java thread programming /
Java Thread Programming shows you how to take full advantage of Java's thread facilities: when to use threads to increase your program's efficiency, how to use them effectively, and how to avoid common mistakes. There is thorough coverage of the Thread API, ThreadGroup classes, the Runnabl...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
[Indianapolis, Ind.] :
SAMS,
©1999.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover
- Copyright 169;1999 by Sams Publishing
- Contents at a Glance
- TOC36;Contents
- About the Author
- Tell Us What You Think33;
- Introduction
- PART I Threads
- CH36;CHAPTER 1 Introduction to Threads
- What Is a Thread63;
- Why Use Multiple Threads63;
- When Multiple Threads Might Not Be Good
- Javas Built45;in Thread Support
- Easy to Start44; Tough to Master
- CH36;CHAPTER 2 A Simple Two45;Thread Example
- Extending the java46;lang46;Thread Class
- Overriding the run40;41; Method
- Spawning a New Thread
- Putting It All Together
- Summary
- CH36;CHAPTER 3 Creating and Starting a Thread
- Using Thread46;currentThread40;41;
- Naming a Thread58; getName40;41; and setName40;41;
- Thread Constructors
- Enlivening a Thread58; start40;41; and isAlive40;41;
- Using Thread46;sleep40;41;
- Summary
- CH36;CHAPTER 4 Implementing Runnable Versus Extending Thread
- Visual Timer Graphical Component
- Extending Thread and JComponent63;
- Interface java46;lang46;Runnable
- Passing a Runnable Object to a Threads Constructor
- Modifying SecondCounter to Use Runnable
- Checking the Accuracy of SecondCounter
- Improving the Accuracy of SecondCounter
- Summary
- CH36;CHAPTER 5 Gracefully Stopping Threads
- Interrupting a Thread58; interrupt40;41;
- Suspending and Resuming Thread Execution
- Stopping a Thread
- The Best Replacement for stop40;41;44; suspend40;41;44; and resume40;41;
- Daemon Threads
- Summary
- CH36;CHAPTER 6 Thread Prioritization
- System Thread Priorities
- Thread Priority Constants
- Determining the Current Priority58; getPriority40;41;
- Changing the Priority of a Thread58; setPriority40;41;
- Thread States
- Priorities and Scheduling
- Voluntarily Relinquishing the Processor58; Thread46;yield40;41;
- Thread45;Scheduling Scenarios
- Summary
- CH36;CHAPTER 7 Concurrent Access to Objects and Variables
- volatile Member Variable Modifier
- synchronized Method Modifier
- synchronized Statement Block
- static synchronized Methods
- Using the Class45;Level Lock in a synchronized Statement
- Synchronization and the Collections API
- Deadlocks
- Speeding Concurrent Access
- Summary
- CH36;CHAPTER 8 Inter45;thread Communication
- The Need for Inter45;thread Signaling
- The Wait47;Notify Mechanism
- Object API Used for Wait47;Notify
- When to Use notifyAll40;41; Instead of notify40;41;
- Missed Notification
- Early Notification
- CubbyHole Example
- Using join40;41; to Wait for a Thread to Die
- Streaming Data Between Threads Using Pipes
- Using ThreadLocal and InheritableThreadLocal
- Summary
- CH36;CHAPTER 9 Threads and Swing
- Why Isnt the Swing Toolkit Multithread45;Safe63;
- Using SwingUtilities46;invokeLater40;41;
- Using SwingUtilities46;isEventDispatchThread40;41;
- When invokeAndWait40;41; and invokeLater40;41; 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.