资源说明:Index
Index ii
Preface xiii
HowtoUsethisBook xiii
CodeExamples 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.ExploitingMultipleProcessors 3
1.2.2.SimplicityofModeling 3
1.2.3.SimplifiedHandlingofAsynchronousEvents 3
1.2.4.MoreResponsiveUserInterfaces 4
1.3. Risks of Threads 5
1.3.1.SafetyHazards 5
1.3.2.LivenessHazards 6
1.3.3.PerformanceHazards 6
1.4. Threads are Everywhere 8
Part I: Fundamentals 10
Chapter 2. Thread Safety 11
2.1.WhatisThreadSafety? 12
2.2.Atomicity 13
2.3.Locking 16
2.4.GuardingStatewithLocks 19
2.5.LivenessandPerformance 20
Chapter 3. Sharing Objects 23
3.1.Visibility 23
3.2.PublicationandEscape 26
3.3.ThreadConfinement 28
3.4.Immutability 31
3.5.SafePublication 33
Chapter 4. Composing Objects 37
4.1.DesigningaThreadͲsafeClass 37
4.2.InstanceConfinement 39
4.3.DelegatingThreadSafety 41
4.4.AddingFunctionalitytoExistingThreadͲsafeClasses 47
4.5.DocumentingSynchronizationPolicies 49
Chapter 5. Building Blocks 51
5.1.SynchronizedCollections 51
5.2.ConcurrentCollections 54
5.3.BlockingQueuesandtheProducerͲconsumerPattern 56
5.4.BlockingandInterruptibleMethods 59
5.5.Synchronizers 60
5.6.BuildinganEfficient,ScalableResultCache 64
SummaryofPartI 69
iii
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。