- One of Java's most powerful capabilities is its built-in support for concurrent programming, a design technique in which multiple concurrent activities-threads take place inside a single Java program. Thread programming enables developers to design applications that are more responsive to user demands, faster, and more easily controlled.
- This book offers comprehensive coverage of this vital aspect of the Java language. The book is completely up-to-date with the new thread model that is now incorporated into the most recent version of the Java Virtual Machine. All Java programmers interested in doing concurrent programming must understand these new concepts. The book approaches the topic from a design pattern point of view. It introduces and summarizes Java's concurrency support, shows readers how to initiate, control, and coordinate concurrent activities, and offers numerous recipe-like techniques for designing and implementing Java structures that solve common concurrent programming challenges. Specifically, the book presents important strategies for avoiding the inconsistencies that can crop up in multi-threaded programs, addresses the concept of "liveness"-how to ensure that all threads in use are kept active simultaneously, examines state-dependent action, and demonstrates effective methods for handling user requests in a multi-threaded environment.
Table of Contents
1. Concurrent Object-Oriented Programming.
Using Concurrency Constructs.
A Particle Applet.
Objects and Concurrency.
Concurrent Execution Constructs.
Concurrency and OO Programming.
Object Models and Mappings.
Further Readings.2. Exclusion.
Fully Synchronized Objects.
Statics and Singletons.
The Java Memory Model.
Confinement Across Methods.
Confinement Within Threads.
Confinement Within Objects.
Confinement Within Groups.
Structuring and Refactoring Classes.
Using Lock Utilities.
Further Readings.3. State Dependence.
Dealing with Failure.
Structuring and Refactoring Classes.
Confinement and Nested Monitors.
Using Concurrency Control Utilities.
Further Readings.4. Creating Threads.
Polling and Event-Driven IO.
Composing Oneway Messages.
Services in Threads.
Further Readings.Index. 0201310090T04062001
In this second edition, you will find thoroughly updated coverage of the Javao 2 platform and new or expanded coverage of:
- Memory model
- Portable parallel programming
- Utility classes for concurrency control
The Java platform provides a broad and powerful set of APIs, tools, and technologies. One of its most powerful capabilities is the built-in support for threads. This makes concurrent programming an attractive yet challenging option for programmers using the Java programming language.
This book shows readers how to use the Java platform's threading model more precisely by helping them to understand the patterns and tradeoffs associated with concurrent programming.
You will learn how to initiate, control, and coordinate concurrent activities using the class java.lang.Thread, the keywords synchronized and volatile, and the methods wait, notify, and notifyAll. In addition, you will find detailed coverage of all aspects of concurrent programming, including such topics as confinement and synchronization, deadlocks and conflicts, state-dependent action control, asynchronous message passing and control flow, coordinated interaction, and structuring web-based and computational services.
The book targets intermediate to advanced programmers interested in mastering the complexities of concurrent programming. Taking a design pattern approach, the book offers standard design techniques for creating and implementing components that solve common concurrent programming challenges. The numerous code examples throughout help clarify the subtleties of the concurrent programming concepts discussed.
Doug Lea is one of the foremost experts on object-oriented technology and software reuse. He has been doing collaborative research with Sun Labs for more than five years. Lea is Professor of Computer Science at SUNY Oswego, Co-director of the Software Engineering Lab at the New York Center for Advanced Technology in Computer Applications, and Adjunct Professor of Electrical and Computer Engineering at Syracuse University. In addition, he co-authored the book, Object-Oriented System Development (Addison-Wesley, 1993). He received his B.A., M.A., and Ph.D. from the University of New Hampshire.