
Java Threads
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Preface
- Who Should Read This Book?
- Versions Used in This Book
- What's New in This Edition?
- Organization of This Book
- Conventions Used in This Book
- Code Examples
- How to Contact Us
- Safari Enabled
- Acknowledgments
- Introduction to Threads
- Java Terms
- Java Versions, Tools, and Code
- About the Examples
- Compiling and Running the Examples
- Why Threads?
- Nonblocking I/O
- Alarms and Timers
- Independent Tasks
- Parallelizable Algorithms
- Summary
- Thread Creation and Management
- What Is a Thread?
- Creating a Thread
- The Example Architecture
- The Thread Class
- The Lifecycle of a Thread
- Creating a Thread
- Starting a Thread
- Terminating a Thread
- Pausing, Suspending, and Resuming Threads
- Thread Cleanup
- Two Approaches to Stopping a Thread
- Setting a Flag
- Interrupting a Thread
- The Runnable Interface
- Threads and Objects
- Determining the Current Thread
- Summary
- Example Classes
- Data Synchronization
- The Synchronized Keyword
- The Volatile Keyword
- More on Race Conditions
- Explicit Locking
- Lock Scope
- Synchronized Blocks
- Choosing a Locking Mechanism
- The Lock Interface
- Nested Locks
- Deadlock
- Lock Fairness
- Summary
- Example Classes
- Thread Notification
- Wait and Notify
- The Wait-and-Notify Mechanism and Synchronization
- wait( ), notify( ), and notifyAll( )
- Wait-and-Notify Mechanism with Synchronized Blocks
- Condition Variables
- Summary
- Example Classes
- Minimal Synchronization Techniques
- Can You Avoid Synchronization?
- The Effect of Registers
- The Effect of Reordering Statements
- Double-Checked Locking
- Atomic Variables
- Overview of the Atomic Classes
- Using the Atomic Classes
- Variable substitution
- Changing algorithms
- Retrying operations
- Notifications and Atomic Variables
- Summary of Atomic Variable Usage
- Data exchange
- Compare and set
- Advanced atomic data types
- Bulk data modification
- Thread Local Variables
- Inheritable Thread Local Variables
- Summary
- Example Classes
- Advanced Synchronization Topics
- Synchronization Terms
- Synchronization Classes Added in J2SE 5.0
- Semaphore
- Barrier
- Countdown Latch
- Exchanger
- Reader/Writer Locks
- Preventing Deadlock
- Deadlock and Automatic Lock Releases
- Preventing Deadlock with Timeouts
- Deadlock Detection
- Lock Starvation
- Lock Starvation and Reader/Writer Locks
- Summary
- Example Classes
- Threads and Swing
- Swing Threading Restrictions
- Processing on the Event-Dispatching Thread
- Using invokeLater( ) and invokeAndWait( )
- Long-Running Event Callbacks
- Summary
- Example Classes
- Threads and Collection Classes
- Overview of Collection Classes
- Collection Interfaces
- Threadsafe Collection Classes
- Thread-Unsafe Collection Classes
- Thread-Notification Collection Classes
- Synchronization and Collection Classes
- Simple Synchronization
- Complex Synchronization
- Iterators and Enumerations
- Thread-Aware Classes
- The Producer/Consumer Pattern
- Using the Collection Classes
- Summary
- Example Classes
- Thread Scheduling
- An Overview of Thread Scheduling
- Priority-Based Scheduling
- The Scheduling Process
- Priority Exceptions
- Priority inversion
- Complex priorities
- Scheduling with Thread Priorities
- Other Thread-Scheduling Methods
- Popular Threading Implementations
- Green Threads
- Windows Native Threads
- Solaris Native Threads
- Linux Native Threads
- Summary
- Example Classes
- Thread Pools
- Why Thread Pools?
- Thread Pools and Throughput
- Why Not Thread Pools?
- Executors
- Using a Thread Pool
- Queues and Sizes
- Rejected Tasks
- Thread Creation
- Callable Tasks and Future Results
- The FutureTask Class
- Single-Threaded Access
- Summary
- Example Classes
- Task Scheduling
- Overview of Task Scheduling
- The java.util.Timer Class
- Using the Timer
- The javax.swing.Timer Class
- Using the javax.swing.Timer Class
- The ScheduledThreadPoolExecutor Class
- Using the ScheduledThreadPoolExecutor Class
- Using the Future Interface
- Summary
- Example Classes
- Threads and I/O
- A Traditional I/O Server
- An Example Multithreaded Server
- Using the multithreaded server
- Scaling Using Traditional I/O
- A New I/O Server
- Nonblocking I/O
- A Single-Threaded NIO Server
- A Multithreaded New I/O Server
- Interrupted I/O
- Summary
- Example Classes
- Miscellaneous Thread Topics
- Thread Groups
- Threads and Java Security
- Daemon Threads
- Threads and Class Loading
- Threads and Exception Handling
- The ThreadDeath Class
- Threads, Stacks, and Memory Usage
- Stack Overflow Errors
- Out of Memory Errors
- Specifying Stack Sizes
- Stack APIs
- Summary
- Example Classes
- Thread Performance
- Overview of Performance
- Measuring Java Performance
- Synchronized Collections
- Atomic Variables and Contended Synchronization
- The ConcurrentHashMap Class
- Thread Creation and Thread Pools
- Summary
- Example Classes
- Parallelizing Loops for Multiprocessor Machines
- Parallelizing a Single-Threaded Program
- Loop Scheduling and Load Balancing
- Static or chunk scheduling
- Self-scheduling
- Guided self-scheduling
- User-defined scheduling
- Variable Classifications
- Loop-private variables
- Read-only variables
- Storeback variables
- Reduction variables
- Shared variables
- Loop Analysis and Transformations
- Loop distribution
- Loop isolation
- Loop interchange
- Loop reimplementation
- Inner-Loop Threading
- Loop Printing
- Multiprocessor Scaling
- A Simple Loop Test
- A Reduction Variable Test
- A Small Inner-Loop Test
- A Printing Test
- Summary
- Example Classes
- Superseded Threading Utilities
- The BusyFlag Class
- The CondVar Class
- The Barrier Class
- The RWLock Class
- The ThreadPool Class
- The JobScheduler Class
- The DaemonLock Class
- Summary
- Index
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.