Book description
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.
Table of contents
-
Programming Concurrency on the JVM
- Copyright
- For the Best Reading Experience...
-
- Table of Contents
- What Readers Are Saying About Programming Concurrency on the JVM
- Preface
- Chapter 1: The Power and Perils of Concurrency
- Part 1: Strategies for Concurrency
- Part 2: Modern Java/JDK Concurrency
-
Part 3: Software Transactional Memory
-
Chapter 6: Introduction to Software Transactional Memory
- Synchronization Damns Concurrency
- The Deficiency of the Object Model
- Separation of Identity and State
- Software Transactional Memory
- Transactions in STM
- Concurrency Using STM
- Concurrency Using Akka/Multiverse STM
- Creating Transactions
- Creating Nested Transactions
- Configuring Akka Transactions
- Blocking Transactions—Sensible Wait
- Commit and Rollback Events
- Collections and Transactions
- Dealing with the Write Skew Anomaly
- Limitations of STM
- Recap
- Chapter 7: STM in Clojure, Groovy, Java, JRuby, and Scala
-
Chapter 6: Introduction to Software Transactional Memory
-
Part 4: Actor-Based Concurrency
-
Chapter 8: Favoring Isolated Mutability
- Isolating Mutability Using Actors
- Actor Qualities
- Creating Actors
- Sending and Receiving Messages
- Working with Multiple Actors
- Coordinating Actors
- Using Typed Actors
- Typed Actors and Murmurs
- Mixing Actors and STM
- Using Transactors
- Coordinating Typed Actors
- Remote Actors
- Limitations of the Actor-Based Model
- Recap
- Chapter 9: Actors in Groovy, Java, JRuby, and Scala
-
Chapter 8: Favoring Isolated Mutability
- Part 5: Epilogue
- Appendix 1: Clojure Agents
- Appendix 2: Web Resources
- Appendix 3: Bibliography
Product information
- Title: Programming Concurrency on the JVM
- Author(s):
- Release date: August 2011
- Publisher(s): Pragmatic Bookshelf
- ISBN: 9781934356760
You might also like
book
Java APIs, Extensions and Libraries: With JavaFX, JDBC, jmod, jlink, Networking, and the Process API
This book completes the Apress Java learning journey and is a comprehensive approach to learning Java …
book
Java 9 Concurrency Cookbook - Second Edition
Master the art of fast, effective Java development with the power of concurrent and parallel programming …
book
Troubleshooting Java Performance: Detecting Anti-Patterns with Open Source Tools
Troubleshoot the most widespread and pernicious Java performance problems using a set of open-source and freely-available …
book
Mastering Concurrency Programming with Java 9 - Second Edition
Master the principles to make applications robust, scalable and responsive About This Book Implement concurrent applications …