Du www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info [...]... Introduction Why Concurrency? 3 Program Architecture and Concurrency Layers of Parallelism 8 Why Not Concurrency? 1 0 Where Are We? 1 1 2 Synchronization and Time Managing Program State 13 14 Identifying Shared vs Private S tate State Machines and Time Isolation 6 15 19 31 Immutability 34 38 Synchronization: Kinds and Techniques Data Synchronization 40 Coordination and Control Synchronization Where... inflection point The software ecosys tem must evolve to better support manycore systems, and this evolution will take time To benefit from rapidly improving computer performance and to retain the "write once, run faster on new hardware" paradigm, the programming community must learn to construct concurrent applications Broader adoption of concurrency will also enable Software + Services through asynchrony... Critical Sections CLR Locks 256 272 Reader I Writer Locks (RWLs) 287 Windows Vista Slim Reader/Writer Lock 289 NET Framework Slim Reader/Writer Lock (3.5) NET Framework Legacy Reader/Writer Lock Condition Variables NET Framework Monitors Guarded Regions Where Are We? Thread Pools 293 300 304 Windows Vista Condition Variables 7 304 309 311 312 315 Thread Pools 1 01 316 Three Ways: Windows Vista, Windows Legacy,... Asynchronous I/O 792 NET Framework Asynchronous I/O I / O Cancellation 778 781 Systems Overlapped I / O 769 772 81 7 822 Asynchronous I/O Cancellation for the Current Thread Synchronous I/O Cancellation for Another Thread Asynchronous I/O Cancellation for Any Thread Where Are We? 824 825 826 16 Graphical User Interfaces CUI Threading Models 829 830 Single Threaded Apartments (STAs) 833 Responsiveness:... ETHREAD, TEB) Contexts 1 51 Inside Thread Creation and Termination Thread Creation Details 1 52 Thread Termination Details Thread Scheduling Thread S tates Priorities Quantums 1 52 1 53 1 54 1 55 1 59 1 63 Priority and Quantum Adjustmen ts Sleeping and Yielding S uspension 1 64 1 67 1 68 Affin ity: Preference for Running on a Particular CPU Where Are We? 5 1 80 Windows Kernel Synchronization 183 The Basics:... Single Threaded Apartments (STAs) 833 Responsiveness: What Is It, Anyway? 836 NET Asynchronous CUI Features 837 NET GUI Frameworks 837 Synchronization Contexts 847 Asynchronous Operations 855 A Convenient Package: BackgroundWorker Where Are We? PART V A 823 856 860 Appendices 863 Designing Reusable libraries for Concurrent NET Programs The 20,000-Foot View 866 www.it-ebooks.info 865 xviii C o n te n... Blocking B 881 884 Parallel Extensions to NET Task Parallel Library 888 Unhandled Exceptions Paren ts and Children Cancellation Futures 887 893 895 897 898 Contin uations 900 Task Managers 902 Putting it All Together: A Helpful Parallel Class Self-Replicating Tasks Parallel LINQ 909 910 Buffering and Merging Order Preservation 912 914 Synchronization Primitives ISupportsCancelation Coun tdownEven t Lazylnit... 601 Lock Convoys Stampeding 603 605 Two-Step Dance 606 Priority Inversion and S tarvation Where Are We? 485 608 609 www.it-ebooks.info 520 xv xvi Contents 12 Parallel Containers 613 Fine-Grained Locking A rrays 616 616 FIFO Queue 61 7 Linked Lists 621 Dictionary (Hash table) Lock Free 626 632 General-Purpose Lock Free FIFO Queue Work S tealing Queue 636 Coordination Containers 640 Producer/Consumer Data... server-side cloud computing The Windows and NET Framework platforms offer rich support for concurrency This support has evolved over more than a decade, since the introduction of multiprocessor support in Windows NT Continued improvements in thread scheduling performance, synchronization APIs, and memory hierarchy awareness-particularly those added in Windows Vista-make Windows the operating system of... eventually PLINQ grew into the Parallel Extensions to the NET Framework technology, I was amazed at how few good books on Windows concurrency were available I remember time and time again being astonished or amazed at some intricate and eso teric bit of concurrency-related information, jotting it down, and earmark ing it for inclusion in this book I only wished somebody had written it down before