Programming Concurrency on the JVM: Mastering Synchronization, STM, and Actors
- Length: 280 pages
- Edition: 1
- Language: English
- Publisher: Pragmatic Bookshelf
- Publication Date: 2011-09-02
- ISBN-10: 193435676X
- ISBN-13: 9781934356760
- Sales Rank: #1591997 (See Top 100 Books)
More than ever, learning to program concurrency is critical to creating faster, responsive applications. Speedy and affordable multicore hardware is driving the demand for high-performing applications, and you can leverage the Java platform to bring these applications to life.
Concurrency on the Java platform has evolved, from the synchronization model of JDK to software transactional memory (STM) and actor-based concurrency. This book is the first to show you all these concurrency styles so you can compare and choose what works best for your applications. You’ll learn the benefits of each of these models, when and how to use them, and what their limitations are.
Through hands-on exercises, you’ll learn how to avoid shared mutable state and how to write good, elegant, explicit synchronization-free programs so you can create easy and safe concurrent applications. The techniques you learn in this book will take you from dreading concurrency to mastering and enjoying it. Best of all, you can work with Java or a JVM language of your choice – Clojure, JRuby, Groovy, or Scala – to reap the growing power of multicore hardware.
If you are a Java programmer, you’d need JDK 1.5 or later and the Akka 1.0 library. In addition, if you program in Scala, Clojure, Groovy or JRuby you’d need the latest version of your preferred language. Groovy programmers will also need GPars.
Programming Concurrency on the JVM Table of Contents What Readers Are Saying About Programming Concurrency on the JVM Preface Who’s This Book For? What’s in This Book? Is it Concurrency or Parallelism? Concurrency for Polyglot Programmers Examples and Performance Measurements Acknowledgments Chapter 1: The Power and Perils of Concurrency 1.1 Threads: The Flow of Execution 1.2 The Power of Concurrency 1.3 The Perils of Concurrency 1.4 Recap Part 1: Strategies for Concurrency Chapter 2: Division of Labor 2.1 From Sequential to Concurrent 2.2 Concurrency in IO-Intensive Apps 2.3 Speedup for the IO-Intensive App 2.4 Concurrency in Computationally Intensive Apps 2.5 Speedup for the Computationally Intensive App 2.6 Strategies for Effective Concurrency 2.7 Recap Chapter 3: Design Approaches 3.1 Dealing with State 3.2 Exploring Design Options 3.3 Shared Mutable Design 3.4 Isolated Mutable Design 3.5 Purely Immutable Design 3.6 Persistent/Immutable Data Structures 3.7 Selecting a Design Approach 3.8 Recap Part 2: Modern Java/JDK Concurrency Chapter 4: Scalability and Thread Safety 4.1 Managing Threads with ExecutorService 4.2 Coordinating Threads 4.3 Exchanging Data 4.4 Java 7 Fork-Join API 4.5 Scalable Collections 4.6 Lock vs. Synchronized 4.7 Recap Chapter 5: Taming Shared Mutability 5.1 Shared Mutability != public 5.2 Spotting Concurrency Issues 5.3 Preserve Invariant 5.4 Mind Your Resources 5.5 Ensure Visibility 5.6 Enhance Concurrency 5.7 Ensure Atomicity 5.8 Recap Part 3: Software Transactional Memory Chapter 6: Introduction to Software Transactional Memory 6.1 Synchronization Damns Concurrency 6.2 The Deficiency of the Object Model 6.3 Separation of Identity and State 6.4 Software Transactional Memory 6.5 Transactions in STM 6.6 Concurrency Using STM 6.7 Concurrency Using Akka/Multiverse STM 6.8 Creating Transactions 6.9 Creating Nested Transactions 6.10 Configuring Akka Transactions 6.11 Blocking Transactions—Sensible Wait 6.12 Commit and Rollback Events 6.13 Collections and Transactions 6.14 Dealing with the Write Skew Anomaly 6.15 Limitations of STM 6.16 Recap Chapter 7: STM in Clojure, Groovy, Java, JRuby, and Scala 7.1 Clojure STM 7.2 Groovy Integration 7.3 Java Integration 7.4 JRuby Integration 7.5 Choices in Scala 7.6 Recap Part 4: Actor-Based Concurrency Chapter 8: Favoring Isolated Mutability 8.1 Isolating Mutability Using Actors 8.2 Actor Qualities 8.3 Creating Actors 8.4 Sending and Receiving Messages 8.5 Working with Multiple Actors 8.6 Coordinating Actors 8.7 Using Typed Actors 8.8 Typed Actors and Murmurs 8.9 Mixing Actors and STM 8.10 Using Transactors 8.11 Coordinating Typed Actors 8.12 Remote Actors 8.13 Limitations of the Actor-Based Model 8.14 Recap Chapter 9: Actors in Groovy, Java, JRuby, and Scala 9.1 Actors in Groovy with GPars 9.2 Java Integration 9.3 JRuby Akka Integration 9.4 Choices in Scala 9.5 Recap Part 5: Epilogue Chapter 10: Zen of Programming Concurrency 10.1 Exercise Your Options 10.2 Concurrency: Programmer’s Guide 10.3 Concurrency: Architect’s Guide 10.4 Choose Wisely Appendix 1: Clojure Agents Appendix 2: Web Resources Appendix 3: Bibliography You May Be Interested In…
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.