Concurrent Programming in Java: Design Principles and Patterns, 2/e
暫譯: Java中的並發程式設計:設計原則與模式(第二版)

Doug Lea

  • 出版商: Addison Wesley
  • 出版日期: 1999-10-25
  • 售價: $2,900
  • 貴賓價: 9.5$2,755
  • 語言: 英文
  • 頁數: 432
  • 裝訂: Paperback
  • ISBN: 0201310090
  • ISBN-13: 9780201310092
  • 相關分類: Java 程式語言
  • 已過版

買這商品的人也買了...

商品描述


Description

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.

Back to Top


Table Of Contents

1. Concurrent Object-Oriented Programming.
Using Concurrency Constructs.
A Particle Applet.
Thread Mechanics.
Further Readings.

Objects and Concurrency.
Concurrency.
Concurrent Execution Constructs.
Concurrency and OO Programming.
Object Models and Mappings.
Further Readings.

Design Forces.
Safety.
Liveness.
Performance.
Reusability.
Further Readings.

Before/After Patterns.
Layering.
Adapters.
Subclassing.
Method Adapters.
Further Readings.


2. Exclusion.
Immutability.
Applications.
Construction.

Synchronization.
Mechanics.
Fully Synchronized Objects.
Traversal.
Statics and Singletons.
Deadlock.
Resource Ordering.
The Java Memory Model.
Further Readings.

Confinement.
Confinement Across Methods.
Confinement Within Threads.
Confinement Within Objects.
Confinement Within Groups.
Further Readings.

Structuring and Refactoring Classes.
Reducing Synchronization.
Splitting Synchronization.
Read-Only Adapters.
Copy-on-Write.
Open Containers.
Further Readings.

Using Lock Utilities.
Mutexes.
Read-Write Locks.
Further Readings.


3. State Dependence.
Dealing with Failure.
Exceptions.
Cancellation.
Further Readings.

Guarded Methods.
Guarded Suspension.
Monitor Mechanics.
Guarded Waits.
Notifications.
Timed Waits.
Busy Waits.

Structuring and Refactoring Classes.
Tracking State.
Conflict Sets.
Subclassing.
Confinement and Nested Monitors.
Further Readings.

Using Concurrency Control Utilities.
Semaphores.
Latches.
Exchangers.
Condition Variables.
Further Readings.

Joint Actions.
General Solutions.
Decoupling Observers.
Further Readings.

Transactions.
Transaction Protocols.
Transaction Participants.
Creating Transactions.
Vetoable Changes.
Further Readings.

Implementing Utilities.
Acquire-Release Protocols.
Delegated Actions.
Specific Notifications.
Further Readings.


4. Creating Threads.
Oneway Messages.
Message Formats.
Open Calls.
Thread-Per-Message.
Worker Threads.
Polling and Event-Driven IO.
Further Readings.

Composing Oneway Messages.
Composition.
Assembly Line.
Further Readings.

Services in Threads.
Completion Callbacks.
Joining Threads.
Futures.
Scheduling Services.
Further Readings.

Parallel Decomposition.
Fork/Join.
Computation Trees.
Barriers.
Further Readings.

Active Objects.
CSP.
Further Readings.


Index. 0201310090T04062001


Back to Top

商品描述(中文翻譯)

描述
Java 最強大的功能之一是其內建對並發編程的支持,這是一種設計技術,允許多個並發活動(執行緒)在單一 Java 程式中同時進行。執行緒編程使開發人員能夠設計出對用戶需求更具響應性、更快速且更易於控制的應用程式。本書全面涵蓋了 Java 語言這一重要方面。該書完全更新至最新版本的 Java 虛擬機所整合的新執行緒模型。所有對並發編程感興趣的 Java 程式設計師必須理解這些新概念。本書從設計模式的角度探討該主題。它介紹並總結了 Java 的並發支持,展示了如何啟動、控制和協調並發活動,並提供了許多類似食譜的技術,用於設計和實現解決常見並發編程挑戰的 Java 結構。具體而言,本書提出了避免多執行緒程式中可能出現的不一致性的重要策略,討論了「活性」的概念——如何確保所有正在使用的執行緒同時保持活躍,檢視狀態依賴行為,並展示在多執行緒環境中處理用戶請求的有效方法。

目錄
1. 並發物件導向編程
使用並發結構
粒子 Applet
執行緒機制
進一步閱讀
物件與並發
並發
並發執行結構
並發與物件導向編程
物件模型與映射
進一步閱讀
設計力量
安全性
活性
性能
可重用性
進一步閱讀
前/後模式
分層
適配器
子類化
方法適配器
進一步閱讀

2. 排他性
不可變性
應用
構建
同步
機制
完全同步物件
遍歷
靜態與單例
死鎖
資源排序
Java 記憶體模型
進一步閱讀
隔離
方法間的隔離
執行緒內的隔離
物件內的隔離
群組內的隔離
進一步閱讀
結構化與重構類別
減少同步
拆分同步
只讀適配器
寫時複製
開放容器
進一步閱讀
使用鎖工具
互斥鎖
讀寫鎖
進一步閱讀

3. 狀態依賴
處理失敗
異常
取消
進一步閱讀
受保護的方法
受保護的暫停
監視器機制
受保護的等待
通知
定時等待
忙等待
結構化與重構類別
追蹤狀態
衝突集
子類化
隔離與嵌套監視器
進一步閱讀
使用並發控制工具
信號量
鎖存器
交換器
條件變數
進一步閱讀
聯合行動
一般解決方案
解耦觀察者
進一步閱讀
交易
交易協議
交易參與者
創建交易
可否決的變更
進一步閱讀
實現工具
獲取-釋放協議
委派行動
特定通知
進一步閱讀

4. 創建執行緒
單向消息
消息格式
開放調用
每消息一執行緒
工作執行緒
輪詢與事件驅動 IO
進一步閱讀
組合單向消息
組合
生產線
進一步閱讀
執行緒中的服務
完成回調
加入執行緒
未來
調度服務
進一步閱讀
平行分解
分叉/合併
計算樹
障礙
進一步閱讀
活躍物件
CSP
進一步閱讀

索引 0201310090T04062001