没有合适的资源?快使用搜索试试~ 我知道了~
首页Concurrent Programming in Java Design Principles and Pattern.pdf
Concurrent Programming in Java Design Principles and Pattern.pdf
需积分: 12 42 下载量 175 浏览量
更新于2023-06-10
评论
收藏 2.48MB PDF 举报
Doug Lea Java Concurrent Programming
资源详情
资源评论
资源推荐
Concurrent Programming in Java™: Design Principles and Patterns, Second
Edition
By Doug Lea
Publishe
r
: Addison Wesley
Pub Date: October 01, 1999
ISBN: 0-201-31009-0
Pages: 432
In Concurrent Programming in Java, Second Edition, you will find thoroughly
updated coverage of the Java 2 platform and new or expanded coverage of:
• Memory model
• Cancellation
• 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
p
recisely 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.
Copyright
Acknowledgments
Chapter 1. Concurrent Object-Oriented Programming
Section 1.1. Using Concurrency Constructs
Section 1.2. Objects and Concurrency
Section 1.3. Design Forces
Section 1.4. Before/After Patterns
Chapter 2. Exclusion
Section 2.1. Immutability
Section 2.2. Synchronization
Section 2.3. Confinement
Section 2.4. Structuring and Refactoring Classes
Section 2.5. Using Lock Utilities
Chapter 3. State Dependence
Section 3.1. Dealing with Failure
Section 3.2. Guarded Methods
Section 3.3. Structuring and Refactoring Classes
Section 3.4. Using Concurrency Control Utilities
Section 3.5. Joint Actions
Section 3.6. Transactions
Section 3.7. Implementing Utilities
Chapter 4. Creating Threads
Section 4.1. Oneway Messages
Section 4.2. Composing Oneway Messages
Section 4.3. Services in Threads
Section 4.4. Parallel Decomposition
Section 4.5. Active Objects
Copyright
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book and Addison-Wesley was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Duke™ designed by Joe Palrang.
Sun Microsystems, Inc. has intellectual property rights relating to implementations of the technology
described in this publication. In particular, and without limitation, these intellectual property rights
may include one or more U.S. patents, foreign patents, or pending applications. Sun, Sun
Microsystems, the Sun Logo, and all Sun, Java, Jini, and Solaris based trademarks and logos are
trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other
countries. UNIX is a registered trademark in the United States and other countries, exclusively
licensed through X/Open Company, Ltd.
As used in this book, the terms "Java virtual machine" and "JVM" mean a virtual machine for the Java
platform.
THIS PUBLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-
INFRINGEMENT.
THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR
TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE
INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS
OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS
AND/OR CHANGES IN ANY TECHNOLOGY, PRODUCT, OR PROGRAM DESCRIBED IN
THIS PUBLICATION AT ANY TIME.
The author and publisher have taken care in the preparation of this document, but make no expressed
or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
Library of Congress Card Number 99-066823
Copyright © 2000 by Addison Wesley Longman, Inc. All rights reserved. No part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means,
electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the
publisher. Printed in the United States of America. Published simultaneously in Canada.
Text printed on recycled and acid-free paper.
2 3 4 5 6 7 - MA - 02 01 00 99
Second printing, November 1999
Acknowledgments
This book began as a small set of Web pages that I put together in spring 1995, while trying to make
sense of my own early attempts to use Java concurrency features in experimental development efforts.
Then it grew; first on the World Wide Web, where I extended, expanded, and removed patterns to
reflect my and other people's increasing experience with Java concurrency; and now into this book,
which places patterns within the broader perspective of concurrent software development. The web
pages also live on, but they now serve as a supplement to the conceptual presentations best suited to
book form.
There have been many changes along the way, in a process that has benefited from commentary,
suggestions, errata reports, and exchanges with many kind and knowledgeable people. These include
Ole Agesen, Tatsuya Aoyagi, Taranov Alexander, Moti Ben-Ari, Peter Buhr, Bruce Chapman, Il-
Hyung Cho, Colin Cooper, Kelly Davis, Bruce Eckel, Yacov Eckel, Saleh Elmohamed, Ed Falis,
Randy Farmer, Glenn Goldstein, David Hanson, Jyrki Heikkinen, Alain Hsiung, Jerry James,
Johannes Johannsen, Istvan Kiss, Ross Knippel, Bil Lewis, Sheng Liang, Jonathan Locke, Steve
MacDonald, Hidehiko Masuhara, Arnulf Mester, Mike Mills, Trevor Morris, Bill Pugh, Andrew
Purshottam, Simon Roberts, John Rose, Rodney Ryan, Joel Rosi-Schwartz, Miles Sabin, Aamod Sane,
Beverly Sanders, Doug Schmidt, Kevin Shank, Yukari Shirota, David Spitz, David Stoutamire, Henry
Story, Sumana Srinivasan, Satish Subramanian, Jeff Swartz, Patrick Thompson, Volker Turau, Dennis
Ulrich, Cees Vissar, Bruce Wallace, Greg Wilson, Grant Woodside, Steve Yen, and Dave Yost, as
well as people who submitted anonymous electronic mail commentary.
The members of Ralph Johnson's patterns seminar (especially Brian Foote and Ian Chai) read through
early forms of some patterns and suggested many improvements. Raj Datta, Sterling Barrett, and
Philip Eskelin of the New York City Patterns Group, and Russ Rufer, Ming Kwok, Mustafa Ozgen,
Edward Anderson, and Don Chin of the Silicon Valley Patterns Group performed similar valuable
service for preliminary versions of the second edition.
Official and unofficial reviewers of the first- and second-edition manuscripts made helpful comments
and suggestions on tight schedules. They include Ken Arnold, Josh Bloch, Joseph Bowbeer, Patrick
Chan, Gary Craig, Desmond D'Souza, Bill Foote, Tim Harrison, David Henderson, Tim Lindholm,
Tom May, Oscar Nierstrasz, James Robins, Greg Travis, Mark Wales, Peter Welch, and Deborra
Zukowski. Very special thanks go to Tom Cargill for his many insights and corrections, as well as for
permission to include a description of his Specific Notification pattern. Very special thanks also go to
David Holmes for, among many contributions, helping to develop and extend material for tutorials
that in turn became included in the second edition.
Rosemary Simpson contributed numerous improvements in the course of creating the index. Ken
Arnold patiently helped me deal with FrameMaker. Mike Hendrickson and the editorial crew at
Addison-Wesley have been continually supportive.
This book would not have been possible without the generous support of Sun Labs. Thanks especially
to Jos Marlowe and Steve Heller for providing opportunities to work collaboratively on fun and
exciting research and development projects.
Thanks above all to Kathy, Keith, and Colin for tolerating all this.
Doug Lea, September, 1999
Chapter 1. Concurrent Object-Oriented Programming
This book discusses some ways of thinking about, designing, and implementing concurrent programs
in the Java™ programming language. Most presentations in this book assume that you are an
experienced developer familiar with object-oriented (OO) programming, but have little exposure to
concurrency. Readers with the opposite background — experience with concurrency in other
languages — may also find this book useful.
The book is organized into four coarse-grained chapters. (Perhaps parts would be a better term.) This
first chapter begins with a brief tour of some frequently used constructs and then backs up to establish
a conceptual basis for concurrent object-oriented programming: how concurrency and objects fit
together, how the resulting design forces impact construction of classes and components, and how
some common design patterns can be used to structure solutions.
The three subsequent chapters are centered around use (and evasion) of the three kinds of concurrency
constructs found in the Java programming language:
Exclusion. Maintaining consistent states of objects by preventing unwanted interference among
concurrent activities, often using
synchronized methods.
State dependence. Triggering, preventing, postponing, or recovering from actions depending on
whether objects are in states in which these actions could or did succeed, sometimes using monitor
methods
Object.wait, Object.notify, and Object.notifyAll.
剩余317页未读,继续阅读
studentN2
- 粉丝: 1
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0