معرفی کتاب «High-performance Java platform computing : [multithreaded and networked programming» نوشتهٔ Thomas W. Christopher, George K. Thiruvathukal، منتشرشده توسط نشر Prentice Hall PTR در سال 2000. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «High-performance Java platform computing : [multithreaded and networked programming» در دستهٔ بدون دستهبندی قرار دارد.
Threading and concurrency are crucial to building high-performance Java applications -- but they have a reputation for complexity. High Performance Java Computing thoroughly demystifies these advanced development techniques. It delivers practical programming solutions, proven design patterns, and a rigorously-tested code library -- everything developers need to build optimized Java software for technical, business, and E-commerce applications. Start by understanding how threading and concurrency can be used to solve a wide variety of performance problems, enabling the construction of more powerful networked applications. Master the Java 2 Threads classes, including daemon threads, thread control, scheduling, and more. Review the key problems of parallelism -- including deadlocks, race conditions, and synchronization -- and discover proven techniques for avoiding or resolving them. Finally, master advanced techniques for building optimized concurrent code, including Java monitors, parallel execution of subroutines in shared memory, and parallelizing loops. Table of Contents Cover Contents Chapter 1: Foundations The von Neumann Machine Flynn's Taxonomy Control-Memory Taxonomy Speedup and Efficiency Amdahl's Law Scalability Problems of Parallelism Grain Size Starvation Deadlock Flooding and Throttling Layout Latency Scheduling Programming Techniques Chapter Wrap-up Exercises Chapter 2: Threads Why is Multithreading Useful? Overview of the Java Threads Classes Thread: The Class Responsible for Thread Creation and Execution Runnable: Making Threads Without Extending the Thread Class Hello World: A First Example of Multithreading Implementing Interfaces and Extending Classes: What's the Deal? Concepts A Little Bit of History Some Definitions Multiprogramming vs. Multitasking o Java Support for Multiprogramming Concurrency vs. Parallelism vs. Distribution Threads vs. Processes o Unix Processes Kernel-level vs. User-level Threads Quick Tour of Java Threads Functions Construction Daemon Threads Thread Control Very Useful Static Methods Thread Synchronization Cooperative Multitasking Prioritized Scheduling Miscellaneous Status Methods Methods Not Covered Here Exercises Chapter 3: Race Conditions and Mutual Exclusion Know Your Enemy! Race Conditions Egoist: A First Study in Race Conditions A Word on Priorities What is a Race Condition? Race0 Class Critical Sections and Object Locking Race1 Class--Fixing Race0 with Synchronization Conditions Motivating the Need for Conditions Key Object Methods Needed to Work with Conditions in Java File Copying: A Producer-Consumer Example Locks-Binary Semaphores: An Example of Using Conditions Race2: Reworked Race1 Using Locks Classic Synchronization Mechanisms Counting Semaphore Barrier Futures Deadlock What is Deadlock? How to Know When Deadlock Has Hit You? Four Conditions of Deadlock A Classic Example: Dining Philosophers Chapter Wrap-up Exercises Chapter 4: Monitors Real Monitors and Java Monitors Shared Classes Explicit Queues Overall Class Monitor in the Thread Package Monitor's Methods Interface MonitorCondition's Methods Interface MonitorLock Examples using Monitor Objects SimpleFuture SharedTableOfQueues Implementation of Monitor, Condition, and MonitorLock Monitor Entry and Exit Monitor.Condition Monitor.Lock The Multiple Reader-Writer Monitors Policies Entering and Leaving the Critical Sections The Single-Reader-Writer Monitor The Readers-Preferred Monitor The Writers-Preferred Monitor The Alternating Readers-Writers Monitor The Take-a-Number Monitor Chapter Wrap-up Exercises Chapter 5: Parallel Execution of Subroutines in Shared Memory Creating and Joining Example: Trapezoidal Numeric Integration o Principles o Interface o Code o Discussion RunQueue RunQueue Methods o Managing the created threads o Termination o Adjusting maxThreadsCreated o Adjusting maxThreadsWaiting o Adjusting waitTime RunQueue Implementation o Fields o Xeqthreads o Enqueueing Runnables o Dequeueing Runnables Recursive Shell Sort: RunQueues and SimpleFutures ShellsortDC ShellsortDC Sort class Accumulator Accumulator Operations Patterns of Use of Accumulators o Awaiting completion o And or Or o Associative, commutative operations o Shared data structures Using Accumulators Numeric Integration TerminationGroup Combinatorial Search The 0-1 Knapsack Problem Parallel Depth-first Search for the Knapsack Problem Knapsack2 o Constructor o Method gen() o The Search class o Methods getSelected() and getProfit() PriorityRunQueue Branch-and-Bound with Priority Run Queues Branch and Bound for 0-1 Knapsack o Class Search o Class SearchFactory o Constructor A Purer Branch-and-Bound 0-1 Knapsack Chapter Wrap-up Exercises Chapter 6: Parallelizing Loops Chore Graphs Gathering Chores into Threads Example: Warshall's Algorithm Static Scheduling Dynamic Scheduling Example: Longest Common Subsequence Example: Shell Sort ShellsortBarrier class Class Sort Performance Chapter Wrap-up Exercises Chapter 7: Chores The RunDelayed Interface Futures FutureFactory Chore-programming Techniques Job Jars Chore Graphs Macro Dataflow o Macro dataflow chore graphs o Chore constructors o Fetching operands Flow of Control o Changing run queues o Switch statement o Create a continuation object o Create a local continuation object Macro Dataflow Examples: Vector Addition Continuations to Separate Operand Fetch from Operation Static Dataflow Style and Storing Operands in Instructions Fetching in continuations Chore Examples: Warshall's Algorithm WarshallDF1 and Warshall's Algorithm in Dataflow WarshallC1 through WarshallC3: Chores, But not Dataflow o WarshallC1 o WarshallC2 o WarshallC3 Chapter Wrap-up Exercises Chapter 8: Thread and Chore Synchronization TerminationGroup Barrier BarrierFactory AccumulatorFactory Parallel Quicksort Method sort() QuickSortThread2 Method quicksort() Shell Sort Chapter Wrap-up Chapter 9: Shared Tables of Queues Shared Tables of Queues Methods Implementing Synchronizations Using a Shared Table of Queues Named Futures Named, Locked Records Named Locks Named Semaphores Named Queues Indexed Keys Implementing More Synchronizations and Shared Structures Bounded buffers I-structures Barriers Reactive Objects Communicating through a Shared Table of Queues closure Block Performance Future Queues Methods Implementation of FutureQueue o Desired behavior o States of the future queue Example of FutureQueue: The Queued Readers-Writers Monitor o State of the monitor Future Tables Chapter Wrap-up Exercises Chapter 10: Streams Essentials The Streams Abstraction Building Your Own Stream Caesar Cipher: Very Basic Encryption Chapter Wrap-Up Exercises Chapter 11: Networking Exploring the Client Side Services: The Internet Story Destination Sendmail Java Networking: Socket and InetAddress Java packages used The use of OOP to create the GUI The constructor Layouts Event handling Sending mail: the final frontier Where are The Services? A Kind and Gentle Introduction to the Server Side Iterative Servers Simple Messaging Architecture The Message Class DateService and DateClient SMA Style Chapter Wrap-Up Exercises Chapter 12: Coordination Generic Mailbox Invocations GMI: Goals and Design Overview Callable: An Interface for Accepting Communication CallMessage: An Abstract Class for Marshalling and Unmarshalling! RemoteCallServer RemoteCallServerDispatcher RemoteCallClient Memo: A Remote Interface to SharedTableOfQueues Design MemoServer MemoClient Vector Inner Product Trapezoidal Integration Warshall's Algorithm Chapter Wrap-up Exercises Index Cover 1 Contents 2 Chapter 1: Foundations 12 The von Neumann Machine 13 Flynn’s Taxonomy 13 Control–Memory Taxonomy 15 Speedup and Efficiency 16 Amdahl’s Law 18 Scalability 19 Problems of Parallelism 21 Grain Size 21 Starvation 22 Deadlock 22 Flooding and Throttling 22 Layout 23 Latency 24 Scheduling 24 Programming Techniques 26 Chapter Wrap-up 26 Exercises 27 Chapter 2: Threads 30 Why is Multithreading Useful? 31 Overview of the Java Threads Classes 32 Thread: The Class Responsible for Thread Creation and Execution 32 Runnable: Making Threads Without Extending the Thread Class 34 Hello World: A First Example of Multithreading 36 Implementing Interfaces and Extending Classes: What’s the Deal? 38 Concepts 39 A Little Bit of History 40 Some Definitions 41 Multiprogramming vs. Multitasking 42 Java Support for Multiprogramming 42 Concurrency vs. Parallelism vs. Distribution 43 Threads vs. Processes 44 Unix Processes 46 Kernel-level vs. User-level Threads 47 Quick Tour of Java Threads Functions 48 Construction 48 Daemon Threads 49 Thread Control 49 Very Useful Static Methods 50 Thread Synchronization 50 Cooperative Multitasking 51 Prioritized Scheduling 51 Miscellaneous Status Methods 52 Methods Not Covered Here 52 Exercises 52 Chapter 3: Race Conditions and Mutual Exclusion 54 Know Your Enemy! 55 Race Conditions 55 Egoist: A First Study in Race Conditions 55 A Word on Priorities 57 What is a Race Condition? 58 Race0 Class 59 Critical Sections and Object Locking 63 Race1 Class—Fixing Race0 with Synchronization 64 Conditions 66 Motivating the Need for Conditions 66 Key Object Methods Needed to Work with Conditions in Java 68 File Copying: A Producer–Consumer Example 69 Locks–Binary Semaphores: An Example of Using Conditions 79 Race2: Reworked Race1 Using Locks 82 Classic Synchronization Mechanisms 84 Counting Semaphore 84 Barrier 86 Futures 87 Deadlock 89 What is Deadlock? 89 How to Know When Deadlock Has Hit You? 89 Four Conditions of Deadlock 89 A Classic Example: Dining Philosophers 90 Chapter Wrap-up 96 Exercises 98 Chapter 4: Monitors 100 Real Monitors and Java Monitors 100 Shared Classes 101 Explicit Queues 101 Overall 102 Class Monitor in the Thread Package 103 Monitor’s Methods 105 Interface MonitorCondition’s Methods 106 Interface MonitorLock 107 Examples using Monitor Objects 108 SimpleFuture 108 SharedTableOfQueues 109 Implementation of Monitor, Condition, and MonitorLock 112 Monitor Entry and Exit 113 Monitor.Condition 116 Monitor.Lock 120 The Multiple Reader–Writer Monitors 121 Policies 122 Entering and Leaving the Critical Sections 123 The Single-Reader–Writer Monitor 123 The Readers-Preferred Monitor 124 The Writers-Preferred Monitor 126 The Alternating Readers–Writers Monitor 128 The Take-a-Number Monitor 130 Chapter Wrap-up 131 Exercises 132 Chapter 5: Parallel Execution of Subroutines in Shared Memory 134 Creating and Joining 135 Example: Trapezoidal Numeric Integration 136 Principles 136 Interface 137 Code 138 Discussion 139 RunQueue 140 RunQueue Methods 140 Managing the created threads 141 Termination 142 Adjusting maxThreadsCreated 142 Adjusting maxThreadsWaiting 143 Adjusting waitTime 143 RunQueue Implementation 144 Fields 144 Xeqthreads 145 Enqueueing Runnables 146 Dequeueing Runnables 147 Recursive Shell Sort: RunQueues and SimpleFutures 149 ShellsortDC 150 ShellsortDC Sort class 151 Accumulator 152 Accumulator Operations 152 Patterns of Use of Accumulators 153 Awaiting completion 153 And or Or 154 Associative, commutative operations 154 Shared data structures 155 Using Accumulators 155 Numeric Integration 155 TerminationGroup 158 Combinatorial Search 160 The 0–1 Knapsack Problem 160 Parallel Depth-first Search for the Knapsack Problem 163 Knapsack2 165 Constructor 166 Method gen() 168 The Search class 168 Methods getSelected() and getProfit() 170 PriorityRunQueue 170 Branch-and-Bound with Priority Run Queues 172 Branch and Bound for 0–1 Knapsack 172 Class Search 172 Class SearchFactory 172 Constructor 177 A Purer Branch-and-Bound 0–1 Knapsack 178 Chapter Wrap-up 179 Exercises 181 Chapter 6: Parallelizing Loops 182 Chore Graphs 183 Gathering Chores into Threads 185 Example: Warshall’s Algorithm 185 Static Scheduling 188 Dynamic Scheduling 188 Example: Longest Common Subsequence 195 Example: Shell Sort 200 ShellsortBarrier class 202 Class Sort 204 Performance 205 Chapter Wrap-up 205 Exercises 206 Chapter 7: Chores 208 The RunDelayed Interface 210 Futures 210 FutureFactory 212 Chore-programming Techniques 212 Job Jars 213 Chore Graphs 213 Macro Dataflow 213 Macro dataflow chore graphs 215 Chore constructors 215 Fetching operands 216 Flow of Control 217 Changing run queues 218 Switch statement 219 Create a continuation object 219 Create a local continuation object 220 Macro Dataflow Examples: Vector Addition 220 Continuations to Separate Operand Fetch from Operation 221 Static Dataflow Style and Storing Operands in Instructions 224 Fetching in continuations 228 Chore Examples: Warshall’s Algorithm 229 WarshallDF1 and Warshall’s Algorithm in Dataflow 230 WarshallC1 through WarshallC3: Chores, But not Dataflow 234 WarshallC1 235 WarshallC2 238 WarshallC3 242 Chapter Wrap-up 247 Exercises 248 Chapter 8: Thread and Chore Synchronization 250 TerminationGroup 250 Barrier 252 BarrierFactory 254 AccumulatorFactory 255 Parallel Quicksort 255 Method sort() 258 QuickSortThread2 258 Method quicksort() 258 Shell Sort 259 Chapter Wrap-up 267 Chapter 9: Shared Tables of Queues 268 Shared Tables of Queues 269 Methods 269 Implementing Synchronizations Using a Shared Table of Queues 271 Named Futures 271 Named, Locked Records 272 Named Locks 272 Named Semaphores 273 Named Queues 273 Indexed Keys 273 Implementing More Synchronizations and Shared Structures 276 Bounded buffers 276 I-structures 277 Barriers 277 Reactive Objects 279 Communicating through a Shared Table of Queues 282 closure 286 Block 286 Performance 287 Future Queues 288 Methods 289 Implementation of FutureQueue 291 Desired behavior 291 States of the future queue 292 Example of FutureQueue: The Queued Readers–Writers Monitor 296 State of the monitor 297 Future Tables 298 Chapter Wrap-up 298 Exercises 299 Chapter 10: Streams Essentials 300 The Streams Abstraction 301 Building Your Own Stream 302 Caesar Cipher: Very Basic Encryption 310 Chapter Wrap-Up 316 Exercises 317 Chapter 11: Networking 318 Exploring the Client Side 319 Services: The Internet Story 321 Destination Sendmail 323 Java Networking: Socket and InetAddress 326 Java packages used 328 The use of OOP to create the GUI 329 The constructor 329 Layouts 330 Event handling 331 Sending mail: the final frontier 331 Where are The Services? 336 A Kind and Gentle Introduction to the Server Side 345 Iterative Servers 346 Simple Messaging Architecture 352 The Message Class 353 DateService and DateClient SMA Style 366 Chapter Wrap-Up 369 Exercises 369 Chapter 12: Coordination 372 Generic Mailbox Invocations 373 GMI: Goals and Design Overview 374 Callable: An Interface for Accepting Communication 374 CallMessage: An Abstract Class for Marshalling and Unmarshalling! 375 RemoteCallServer 376 RemoteCallServerDispatcher 378 RemoteCallClient 380 Memo: A Remote Interface to SharedTableOfQueues 383 Design 383 MemoServer 387 MemoClient 388 Vector Inner Product 390 Trapezoidal Integration 397 Warshall’s Algorithm 402 Chapter Wrap-up 409 Exercises 409 Index 412 A 412 B 412 C 412 D 413 G 414 E 414 F 414 H 415 I 415 K 415 L 415 J 415 M 416 O 417 N 417 P 417 Q 418 R 418 S 419 T 420 U 421 V 421 X 421 W 421 Y 421
- the Clear, Practical Guide To Java Threads And Concurrency
- proven Design Patterns And Extensive Code Library
- expert Techniques For Optimizing Networked/distributed Applications
- avoiding Deadlocks, Race Conditions, And Synchronization Problems
Threading, Concurrency, And Beyond: Your Crystal-clear Java Performance Guide And Code Library!
Threading And Concurrency Are Crucial To Building High-performance Java Applications - But They Have A Reputation For Complexity. High-performance Java Computing Thoroughly Demystifies Them, Helping Developers Leverage Threading And Concurrency To Solve A Wide Variety Of Performance Problems - Especially In Networked, Distributed Applications. This Book Delivers Practical Solutions, Proven Design Patterns, And A Rigorously Tested Code Library: Everything You Need To Build Optimized Java Software For Technical, Business, And E-commerce Applications. Coverage Includes:
- java 2 Threads Classes: Daemon Threads, Thread Control, Scheduling, And More
- solving The Key Problems Of Parallelism: Deadlocks, Race Conditions, And Synchronization
- advanced Techniques For Optimizing Concurrent Code
- java Monitors, Parallelizing Loops, And Parallel Execution Of Subroutines In Shared Memory
- new Design Patterns For Distributed Application Development
There's Never Been A More Accessible, Practical Guide To Java Multi-threading, Concurrency, And Other High-performance Techniques. When Performance Really Matters, Turn To High-performance Java Computing - And Find The Solution You're Searching For!
about The Author:thomas W. Christopher And George K. Thiruvathukal Are Principals In Tools Of Computing Llc, A Chicago-area Consulting Firm Specializing In High-performance Computing And Object-oriented Languages. A Professor Of Computer Science For Over Twenty Years, Christopher Has Written Several Compilers. Thiruvathukal, A Former Computer Scientist At Argonne National Laboratories, Is Now A Visiting Professor At Loyola University In Chicago And Secretary General Of The Java Grande Group, Whose Aim Is To Advance Java-based Scientific And Technical Computing.