
Programming Concurrency on the JVM
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
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.
More details
Other editions
Additional editions

Person
Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and an adjunct faculty at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences.
Content
- Cover
- Table of Contents
- 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
- 1. The Power and Perils of Concurrency
- Threads: The Flow of Execution
- The Power of Concurrency
- The Perils of Concurrency
- Recap
- Part 1-Strategies for Concurrency
- 2. Division of Labor
- From Sequential to Concurrent
- Concurrency in IO-Intensive Apps
- Speedup for the IO-Intensive App
- Concurrency in Computationally Intensive Apps
- Speedup for the Computationally Intensive App
- Strategies for Effective Concurrency
- Recap
- 3. Design Approaches
- Dealing with State
- Exploring Design Options
- Shared Mutable Design
- Isolated Mutable Design
- Purely Immutable Design
- Persistent/Immutable Data Structures
- Selecting a Design Approach
- Recap
- Part 2-Modern Java/JDK Concurrency
- 4. Scalability and Thread Safety
- Managing Threads with ExecutorService
- Coordinating Threads
- Exchanging Data
- Java 7 Fork-Join API
- Scalable Collections
- Lock vs. Synchronized
- Recap
- 5. Taming Shared Mutability
- Shared Mutability != public
- Spotting Concurrency Issues
- Preserve Invariant
- Mind Your Resources
- Ensure Visibility
- Enhance Concurrency
- Ensure Atomicity
- Recap
- Part 3-Software Transactional Memory
- 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
- 7. STM in Clojure, Groovy, Java, JRuby, and Scala
- Clojure STM
- Groovy Integration
- Java Integration
- JRuby Integration
- Choices in Scala
- Recap
- Part 4-Actor-Based Concurrency
- 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
- 9. Actors in Groovy, Java, JRuby, and Scala
- Actors in Groovy with GPars
- Java Integration
- JRuby Akka Integration
- Choices in Scala
- Recap
- Part 5-Epilogue
- 10. Zen of Programming Concurrency
- Exercise Your Options
- Concurrency: Programmer's Guide
- Concurrency: Architect's Guide
- Choose Wisely
- A1. Clojure Agents
- A2. Web Resources
- A3. Bibliography
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.