Preface |
|
ix | |
|
1 Concurrency: An Overview |
|
|
1 | (18) |
|
Introduction to Concurrency |
|
|
1 | (2) |
|
Introduction to Asynchronous Programming |
|
|
3 | (5) |
|
Introduction to Parallel Programming |
|
|
8 | (3) |
|
Introduction to Reactive Programming (Rx) |
|
|
11 | (2) |
|
Introduction to Dataflows |
|
|
13 | (2) |
|
Introduction to Multithreaded Programming |
|
|
15 | (1) |
|
Collections for Concurrent Applications |
|
|
16 | (1) |
|
|
17 | (1) |
|
Summary of Key Technologies |
|
|
17 | (2) |
|
|
19 | (22) |
|
2.1 Pausing for a Period of Time |
|
|
19 | (2) |
|
2.2 Returning Completed Tasks |
|
|
21 | (3) |
|
|
24 | (1) |
|
2.4 Waiting for a Set of Tasks to Complete |
|
|
25 | (2) |
|
2.5 Waiting for Any Task to Complete |
|
|
27 | (2) |
|
2.6 Processing Tasks as They Complete |
|
|
29 | (3) |
|
2.7 Avoiding Context for Continuations |
|
|
32 | (1) |
|
2.8 Handling Exceptions from async Task Methods |
|
|
33 | (2) |
|
2.9 Handling Exceptions from async void Methods |
|
|
35 | (2) |
|
2.10 Creating a ValueTask |
|
|
37 | (2) |
|
2.11 Consuming a ValueTask |
|
|
39 | (2) |
|
|
41 | (14) |
|
Asynchronous Streams and Task<T> |
|
|
41 | (1) |
|
Asynchronous Streams and IEnumerable<T> |
|
|
41 | (1) |
|
Asynchronous Streams and Task<IEnumerable<T>> |
|
|
42 | (1) |
|
Asynchronous Streams and IObservable<T> |
|
|
42 | (1) |
|
|
43 | (1) |
|
3.1 Creating Asynchronous Streams |
|
|
44 | (2) |
|
3.2 Consuming Asynchronous Streams |
|
|
46 | (2) |
|
3.3 Using LINQ with Asynchronous Streams |
|
|
48 | (3) |
|
3.4 Asynchronous Streams and Cancellation |
|
|
51 | (4) |
|
|
55 | (10) |
|
4.1 Parallel Processing of Data |
|
|
55 | (2) |
|
|
57 | (1) |
|
|
58 | (2) |
|
|
60 | (2) |
|
|
62 | (3) |
|
|
65 | (10) |
|
|
65 | (2) |
|
|
67 | (2) |
|
|
69 | (1) |
|
|
70 | (1) |
|
5.5 Parallel Processing with Dataflow Blocks |
|
|
71 | (1) |
|
5.6 Creating Custom Blocks |
|
|
72 | (3) |
|
|
75 | (12) |
|
6.1 Converting NET Events |
|
|
76 | (2) |
|
6.2 Sending Notifications to a Context |
|
|
78 | (2) |
|
6.3 Grouping Event Data with Windows and Buffers |
|
|
80 | (3) |
|
6.4 Taming Event Streams with Throttling and Sampling |
|
|
83 | (1) |
|
|
84 | (3) |
|
|
87 | (14) |
|
7.1 Unit Testing async Methods |
|
|
88 | (2) |
|
7.2 Unit Testing async Methods Expected to Fail |
|
|
90 | (2) |
|
7.3 Unit Testing async void Methods |
|
|
92 | (1) |
|
7.4 Unit Testing Dataflow Meshes |
|
|
93 | (2) |
|
7.5 Unit Testing System.Reactive Observables |
|
|
95 | (2) |
|
7.6 Unit Testing System.Reactive Observables with Faked Scheduling |
|
|
97 | (4) |
|
|
101 | (16) |
|
8.1 Async Wrappers for "Async" Methods with "Completed" Events |
|
|
101 | (2) |
|
8.2 Async Wrappers for "Begin/End" Methods |
|
|
103 | (1) |
|
8.3 Async Wrappers for Anything |
|
|
104 | (2) |
|
8.4 Async Wrappers for Parallel Code |
|
|
106 | (1) |
|
8.5 Async Wrappers for System.Reactive Observables |
|
|
107 | (1) |
|
8.6 System.Reactive Observable Wrappers for async Code |
|
|
108 | (2) |
|
8.7 Asynchronous Streams and Dataflow Meshes |
|
|
110 | (2) |
|
8.8 System.Reactive Observables and Dataflow Meshes |
|
|
112 | (2) |
|
8.9 Converting System.Reactive Observables to Asynchronous Streams |
|
|
114 | (3) |
|
|
117 | (28) |
|
9.1 Immutable Stacks and Queues |
|
|
119 | (2) |
|
|
121 | (2) |
|
|
123 | (2) |
|
9.4 Immutable Dictionaries |
|
|
125 | (2) |
|
9.5 Threadsafe Dictionaries |
|
|
127 | (2) |
|
|
129 | (2) |
|
9.7 Blocking Stacks and Bags |
|
|
131 | (1) |
|
|
132 | (3) |
|
|
135 | (2) |
|
|
137 | (2) |
|
9.11 Asynchronous Stacks and Bags |
|
|
139 | (2) |
|
9.12 Blocking/Asynchronous Queues |
|
|
141 | (4) |
|
|
145 | (16) |
|
10.1 Issuing Cancellation Requests |
|
|
146 | (3) |
|
10.2 Responding to Cancellation Requests by Polling |
|
|
149 | (1) |
|
10.3 Canceling Due to Timeouts |
|
|
150 | (2) |
|
10.4 Canceling async Code |
|
|
152 | (1) |
|
10.5 Canceling Parallel Code |
|
|
153 | (1) |
|
10.6 Canceling System.Reactive Code |
|
|
154 | (2) |
|
10.7 Canceling Dataflow Meshes |
|
|
156 | (1) |
|
10.8 Injecting Cancellation Requests |
|
|
157 | (2) |
|
10.9 Interop with Other Cancellation Systems |
|
|
159 | (2) |
|
11 Functional-Friendly OOP |
|
|
161 | (16) |
|
11.1 Async Interfaces and Inheritance |
|
|
162 | (1) |
|
11.2 Async Construction: Factories |
|
|
163 | (2) |
|
11.3 Async Construction: The Asynchronous Initialization Pattern |
|
|
165 | (3) |
|
|
168 | (3) |
|
|
171 | (3) |
|
|
174 | (3) |
|
|
177 | (14) |
|
|
182 | (2) |
|
|
184 | (1) |
|
|
185 | (2) |
|
|
187 | (1) |
|
|
188 | (3) |
|
|
191 | (6) |
|
13.1 Scheduling Work to the Thread Pool |
|
|
191 | (2) |
|
13.2 Executing Code with a Task Scheduler |
|
|
193 | (2) |
|
13.3 Scheduling Parallel Code |
|
|
195 | (1) |
|
13.4 Dataflow Synchronization Using Schedulers |
|
|
196 | (1) |
|
|
197 | (18) |
|
14.1 Initializing Shared Resources |
|
|
197 | (3) |
|
14.2 System.Reactive Deferred Evaluation |
|
|
200 | (2) |
|
14.3 Asynchronous Data Binding |
|
|
202 | (2) |
|
|
204 | (2) |
|
14.5 Identical Synchronous and Asynchronous Code |
|
|
206 | (2) |
|
14.6 Railway Programming with Dataflow Meshes |
|
|
208 | (2) |
|
14.7 Throttling Progress Updates |
|
|
210 | (5) |
A Legacy Platform Support |
|
215 | (4) |
B Recognizing and Interpreting Asynchronous Patterns |
|
219 | (8) |
Index |
|
227 | |