没有合适的资源?快使用搜索试试~ 我知道了~
Java Concurrency in Practice 无水印pdf

温馨提示
Java Concurrency in Practice 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
资源推荐
资源详情
资源评论
















JavaConcurrency
InPractice
BrianGöetz
TimPeierls
JoshuaBloch
JosephBowbeer
DavidHolmes
DougLea
Addison‐WesleyProfessional
ISBN‐10:0‐321‐34960‐1
ISBN‐13:978‐0‐321‐34960‐6

ii
JavaConcurrencyInPractice
Index
Index ii
Preface xiii
HowtoUsethisBook
xiii
CodeExam
ples xiv
Acknowledgments
xv
Chapter 1 - Introduction 1
1.1. A (Very) Brief History of Concurrency 2
1.2. Benefits of Threads 3
1.2.1.Exploi
tingMultipleProcessors 3
1.2.2.SimplicityofMod
eling 3
1.2.3.Simplifi
edHandlingofAsynchronousEvents 3
1.2.4.MoreRespon
siveUserInterfaces 4
1.3. Risks of Threads 5
1.3.1.SafetyHazard
s 5
1.3.2.LivenessHa
zards 6
1.3.3.Perfor
manceHazards 6
1.4. Threads are Everywhere 8
Part I: Fundamentals 10
Chapter 2. Thread Safety 11
2.1.WhatisThre
adSafety? 12
2.2.Atomi
city 13
2.3.Locking
16
2.4.Guardin
gStatewithLocks 19
2.5.LivenessandPerformance
20
Chapter 3. Sharing Objects 23
3.1.Visi
bility 23
3.2.Public
ationandEscape 26
3.3.Thr
eadConfinement 28
3.4.Immutability
31
3.5.SafePubl
ication 33
Chapter 4. Composing Objects 37
4.1.Designin
gaThread‐safeClass 37
4.2.In
stanceConfinement 39
4.3.Del
egatingThreadSafety 41
4.4.AddingF
unctionalitytoExistingThread‐safeClasses 47
4.5.Docum
entingSynchronizationPolicies 49
Chapter 5. Building Blocks 51
5.1.Sync
hronizedCollections 51
5.2.Concurr
entCollections 54
5.3.BlockingQueuesan
dtheProducer‐consumerPattern 56
5.4.BlockingandInterruptibleMethods
59
5.5.Sync
hronizers 60
5.6.Buildi
nganEfficient,ScalableResultCache 64
SummaryofPartI
69

iii<Index
Part II: Structuring Concurrent Applications 71
Chapter 6. Task Execution 72
6.1.Execut
ingTasksinThreads 72
6.2.Th
eExecutorFramework 74
6.3.FindingExploitableParallelism
78
Summary
83
Chapter 7. Cancellation and Shutdown 85
7.1.Ta
skCancellation 85
7.2.Stop
pingaThread‐basedService 93
7.3.HandlingAbnormalTh
readTermination 100
7.4.JV
MShutdown 102
Summary
103
Chapter 8. Applying Thread Pools 104
8.1.Impli
citCouplingsBetweenTasksandExecutionPolicies 104
8.2.SizingTh
readPools 105
8.3.Configuri
ngThreadPoolExecutor 106
8.4.Extendi
ngThreadPoolExecutor 111
8.5.Parall
elizingRecursiveAlgorithms 112
Summary
116
Chapter 9. GUI Applications 117
9.1.WhyareGUI
sSingle‐threaded? 117
9.2.Short‐r
unningGUITasks 119
9.3.Long‐runningGU
ITasks 121
9.4.Shar
edDataModels 123
9.5.OtherFo
rmsofSingle‐threadedSubsystems 125
Summary
126
Part III: Liveness, Performance, and Testing 127
Chapter 10. Avoiding Liveness Hazards 128
10.1.Deadlock
128
10.2.AvoidingandDiag
nosingDeadlocks 133
10.3.OtherLi
venessHazards 135
Summary
136
Chapter 11. Performance and Scalability 137
11.1.Thi
nkingaboutPerformance 137
11.2.Amda
hl'sLaw 139
11.3.CostsI
ntroducedbyThreads 142
11.4.Re
ducingLockContention 144
11.5.Exampl
e:ComparingMapPerfor mance 150
11.6.Re
ducingContextSwitchOverhead 151
Summary
152
Chapter 12. Testing Concurrent Programs 153
12.1.Te
stingforCorrectness 153
12.2.Te
stingforPerformance 160
12.3.AvoidingPerformanc
eTestingPitfalls 165
12.4.ComplementaryTe
stingApproaches 167
Summary
169
Part IV: Advanced Topics 170
Chapter 13 - Explicit Locks 171
13.1.Lockan
dReentrantLock 171
13.2.Perform
anceConsiderations 174
13.3.Fairn
ess 175

iv
JavaConcurrencyInPractice
13.4.ChoosingBetweenSy
nchronizedandReentrantLock 176
13.5.Re
ad‐writeLocks 176
Summary
178
Chapter 14 - Building Custom Synchronizers 179
14.1.Mana
gingStateDependence 179
14.2.UsingC
onditionQueues 183
14.3.Explici
tConditionObjects 188
14.4.Anatom
yofaSynchronizer 189
14.5.Abs
tractQueuedSynchronizer 190
14.6.AQSinJava.util
.concurrentSynchronizerClasses 192
Summary
194
Chapter 15. Atomic Variables and Non-blocking Synchronization 195
15.1.Dis
advantagesofLocking 195
15.2.HardwareSupp
ortforConcurrency 196
15.3.AtomicVariableClasses
198
15.4.Non‐blo
ckingAlgorithms 201
Summary
206
Chapter 16. The Java Memory Model 207
16.1.WhatisaMemoryModel,an
dWhywouldIWantOne? 207
16.2.Publication
211
Summary
215
Appendix A. Annotations for Concurrency 216
A.1.ClassA
nnotations 216
A.2.Fi
eldandMethodAnnotations 216
Bibliography 217

v1BListingandImageIndex
ListingandImageIndex
Preface v
Listing1.BadWaytoSortaList.Don'tDothis.
xiv
Listing2.LessthanOp
timalWaytoSortaList. xv
Chapter 1. Introduction 11
Listing1.
1.Non‐thread‐safeSequenceGenerator. 5
Figure1.
1.UnluckyExecutionofUnsafeSequence.Nextvalue. 5
Listing1.
2.Thread‐safeSequenceGenerator. 6
Chapter 2. Thread Safety 11
Listing2.
1.AStatelessServlet. 13
Listing2.
2.ServletthatCountsRequestswithouttheNecessarySynchronization. Don'tDothis. 14
Listing2.
3.RaceConditioninLazyInitialization.Don'tDothis. 15
Listing2.
4.ServletthatCountsRequestsUsingAtomicLong. 16
Listing2.
5.ServletthatAttemptstoCacheitsLastResultwithoutAdequateAtomicity.Don'tDothis. 17
Listing2.
6.ServletthatCachesLastResult,ButwithUnacceptablyPoorConcurrency.Don'tDothis. 18
Listing2.
7.CodethatwouldDeadlockifIntrinsicLockswereNotReentrant. 18
Figure2.
1.PoorConcurrencyofSynchronizedFactorizer. 21
Listing2.
8.ServletthatCachesitsLastRequestandResult. 21
Chapter 3. Sharing Objects 23
Listing3.
1.SharingVariableswithoutSynchronization.Don'tDothis. 23
Listing3.
2.Non‐thread‐safeMutableIntegerHolder. 24
Listing3.
3.Thread‐safeMutableIntegerHolder. 24
Figure3.
1.VisibilityGuaranteesforSynchronization. 25
Listing3.
4.CountingSheep. 26
Listing3.
5.PublishinganObject. 27
Listing3.
6.AllowingInternalMutableStatetoEscape.Don'tDothis. 27
Listing3.
7.ImplicitlyAllowingthethisReferencetoEscape.Don'tDothis. 28
Listing3.
8.UsingaFactoryMethodtoPreventthethisReferencefromEscapingDuringConstruction. 28
Listing3.
9.ThreadConfinementofLocalPrimitiveandReferenceVariables. 30
Listing3
.10.UsingThreadLocaltoEnsurethreadConfinement. 30
Listing3
.11.ImmutableClassBuiltOutofMutableUnderlyingObjects. 32
Listing3
.12.ImmutableHolderforCachingaNumberanditsFactors. 33
Listing3
.13.CachingtheLastResultUsingaVolatileReferencetoanImmutableHolderObject. 33
Listing3
.14.PublishinganObjectwitho utAdequateSynchronization.Don'tDothis. 33
剩余233页未读,继续阅读
资源评论

- SunshineTech2017-10-28非常感谢楼主!
- steven_hooke2018-02-19不是原版的,凑合这看吧。
- imyfriend2018-09-26谢谢分享~~~~

yinkaisheng-nj
- 粉丝: 763
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 基于规则算法的功率跟随控制:燃料电池汽车能量管理策略及其MATLAB数据分析
- (源码)基于C++的贪吃蛇游戏.zip
- 基于模态计算与声振耦合仿真的玻璃隔声量研究及其工程应用
- (源码)基于Python和Arduino的复古LED条形音频可视化器.zip
- 基于Matlab的ESMD信号分解算法:极值点驱动的数据处理与分析 · 时频分析
- 基于MATLAB的特征子集选择(FSS)与前后搜索法实现及应用
- (源码)基于Arduino的JoystickBuzzer音乐控制器项目.zip
- 模块化多电平换流器MMC的载波移相调制及PLECS仿真研究:工况参数为AC3.3kvDC6kv,采用N=6配置,优化双闭环控制与均压策略
- 基于UDP千兆以太网协议栈的纯FPGA Verilog OV5640图像采集系统实现
- (源码)基于Android的学习应用.zip
- CNG加气站设计:从背景到工艺流程的全面解析与实施方案
- (源码)基于C++的面试算法学习项目.zip
- 基于MATLAB的石川公式法齿轮时变啮合刚度计算及应用 宝典
- 基于MATLAB的EKF-GMPHD与UKF-GMPHD多目标跟踪算法研究及仿真 v4.0
- (源码)基于C++语言的RGB到YCbCr颜色空间转换系统.zip
- 永磁同步电机接地故障检测与处理的技术解析及Python代码实现 信号处理 (07月)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
