Java Concurrency in Practice
28%
off

Java Concurrency in Practice

4.41 (1,788 ratings by Goodreads)
By (author)  , By (author)  , By (author)  , By (author)  , By (author)  , By (author) 

Free delivery worldwide

Available. Dispatched from the UK in 2 business days
When will my order arrive?

Description

"I was fortunate indeed to have worked with a fantastic team on the design and implementation of the concurrency features added to the Java platform in Java 5.0 and Java 6. Now this same team provides the best explanation yet of these new features, and of concurrency in general. Concurrency is no longer a subject for advanced users only. Every Java developer should read this book."--Martin BuchholzJDK Concurrency Czar, Sun Microsystems"For the past 30 years, computer performance has been driven by Moore's Law; from now on, it will be driven by Amdahl's Law. Writing code that effectively exploits multiple processors can be very challenging. Java Concurrency in Practice provides you with the concepts and techniques needed to write safe and scalable Java programs for today's--and tomorrow's--systems."--Doron RajwanResearch Scientist, Intel Corp"This is the book you need if you're writing--or designing, or debugging, or maintaining, or contemplating--multithreaded Java programs. If you've ever had to synchronize a method and you weren't sure why, you owe it to yourself and your users to read this book, cover to cover."--Ted NewardAuthor of Effective Enterprise Java"Brian addresses the fundamental issues and complexities of concurrency with uncommon clarity. This book is a must-read for anyone who uses threads and cares about performance."--Kirk PepperdineCTO, JavaPerformanceTuning.com"This book covers a very deep and subtle topic in a very clear and concise way, making it the perfect Java Concurrency reference manual. Each page is filled with the problems (and solutions!) that programmers struggle with every day. Effectively exploiting concurrency is becoming more and more important now that Moore's Law is delivering more cores but not faster cores, and this book will show you how to do it."--Dr. Cliff ClickSenior Software Engineer, Azul Systems"I have a strong interest in concurrency, and have probably written more thread deadlocks and made more synchronization mistakes than most programmers. Brian's book is the most readable on the topic of threading and concurrency in Java, and deals with this difficult subject with a wonderful hands-on approach. This is a book I am recommending to all my readers of The Java Specialists' Newsletter, because it is interesting, useful, and relevant to the problems facing Java developers today."--Dr. Heinz KabutzThe Java Specialists' Newsletter"I've focused a career on simplifying simple problems, but this book ambitiously and effectively works to simplify a complex but critical subject: concurrency. Java Concurrency in Practice is revolutionary in its approach, smooth and easy in style, and timely in its delivery--it's destined to be a very important book."--Bruce TateAuthor of Beyond Java"Java Concurrency in Practice is an invaluable compilation of threading know-how for Java developers. I found reading this book intellectually exciting, in part because it is an excellent introduction to Java's concurrency API, but mostly because it captures in a thorough and accessible way expert knowledge on threading not easily found elsewhere."--Bill VennersAuthor of Inside the Java Virtual MachineThreads are a fundamental part of the Java platform. As multicore processors become the norm, using concurrency effectively becomes essential for building high-performance applications. Java SE 5 and 6 are a huge step forward for the development of concurrent applications, with improvements to the Java Virtual Machine to support high-performance, highly scalable concurrent classes and a rich set of new concurrency building blocks. In Java Concurrency in Practice, the creators of these new facilities explain not only how they work and how to use them, but also the motivation and design patterns behind them.However, developing, testing, and debugging multithreaded programs can still be very difficult; it is all too easy to create concurrent programs that appear to work, but fail when it matters most: in production, under heavy load. Java Concurrency in Practice arms readers with both the theoretical underpinnings and concrete techniques for building reliable, scalable, maintainable concurrent applications. Rather than simply offering an inventory of concurrency APIs and mechanisms, it provides design rules, patterns, and mental models that make it easier to build concurrent programs that are both correct and performant.This book covers:Basic concepts of concurrency and thread safety Techniques for building and composing thread-safe classes Using the concurrency building blocks in java.util.concurrent Performance optimization dos and don'ts Testing concurrent programs Advanced topics such as atomic variables, nonblocking algorithms, and the Java Memory Modelshow more

Product details

  • Paperback | 384 pages
  • 177.8 x 233.68 x 25.4mm | 612.35g
  • Pearson Education (US)
  • Addison-Wesley Educational Publishers Inc
  • New Jersey, United States
  • English
  • w. figs.
  • 0321349601
  • 9780321349606
  • 32,484

Back cover copy

"I was fortunate indeed to have worked with a fantastic team on the design and implementation of the concurrency features added to the Java platform in Java 5.0 and Java 6. Now this same team provides the best explanation yet of these new features, and of concurrency in general. Concurrency is no longer a subject for advanced users only. Every Java developer should read this book." --Martin Buchholz JDK Concurrency Czar, Sun Microsystems"For the past 30 years, computer performance has been driven by Moore's Law; from now on, it will be driven by Amdahl's Law. Writing code that effectively exploits multiple processors can be very challenging. "Java Concurrency in Practice" provides you with the concepts and techniques needed to write safe and scalable Java programs for today's--and tomorrow's--systems." --Doron Rajwan Research Scientist, Intel Corp"This is the book you need if you're writing--or designing, or debugging, or maintaining, or contemplating--multithreaded Java programs. If you've ever had to synchronize a method and you weren't sure why, you owe it to yourself and your users to read this book, cover to cover." --Ted Neward Author of "Effective Enterprise Java""Brian addresses the fundamental issues and complexities of concurrency with uncommon clarity. This book is a must-read for anyone who uses threads and cares about performance." --Kirk Pepperdine CTO, JavaPerformanceTuning.com"This book covers a very deep and subtle topic in a very clear and concise way, making it the perfect Java Concurrency reference manual. Each page is filled with the problems (and solutions!) that programmers struggle with every day. Effectively exploiting concurrency is becoming more and more important now that Moore's Law is delivering more cores but not faster cores, and this book will show you how to do it." --Dr. Cliff Click Senior Software Engineer, Azul Systems"I have a strong interest in concurrency, and have probably written more thread deadlocks and made more synchronization mistakes than most programmers. Brian's book is the most readable on the topic of threading and concurrency in Java, and deals with this difficult subject with a wonderful hands-on approach. This is a book I am recommending to all my readers of "The Java Specialists' Newsletter," because it is interesting, useful, and relevant to the problems facing Java developers today." --Dr. Heinz Kabutz "The Java Specialists' Newsletter""I've focused a career on simplifying simple problems, but this book ambitiously and effectively works to simplify a complex but critical subject: concurrency. "Java Concurrency in Practice" is revolutionary in its approach, smooth and easy in style, and timely in its delivery--it's destined to be a very important book." --Bruce Tate Author of "Beyond Java"""Java Concurrency in Practice" is an invaluable compilation of threading know-how for Java developers. I found reading this book intellectually exciting, in part because it is an excellent introduction to Java's concurrency API, but mostly because it captures in a thorough and accessible way expert knowledge on threading not easily found elsewhere." --Bill Venners Author of "Inside the Java Virtual Machine"Threads are a fundamental part of the Java platform. As multicore processors become the norm, using concurrency effectively becomes essential for building high-performance applications. Java SE 5 and 6 are a huge step forward for the development of concurrent applications, with improvements to the Java Virtual Machine to support high-performance, highly scalable concurrent classes and a rich set of new concurrency building blocks. In "Java Concurrency in Practice," the creators of these new facilities explain not only how they work and how to use them, but also the motivation and design patterns behind them.However, developing, testing, and debugging multithreaded programs can still be very difficult; it is all too easy to create concurrent programs that appear to work, but fail when it matters most: in production, under heavy load. "Java Concurrency in Practice" arms readers with both the theoretical underpinnings and concrete techniques for building reliable, scalable, maintainable concurrent applications. Rather than simply offering an inventory of concurrency APIs and mechanisms, it provides design rules, patterns, and mental models that make it easier to build concurrent programs that are both correct and performant.This book covers: Basic concepts of concurrency and thread safety Techniques for building and composing thread-safe classes Using the concurrency building blocks in java.util.concurrent Performance optimization dos and don'ts Testing concurrent programs Advanced topics such as atomic variables, nonblocking algorithms, and the Java Memory Modelshow more

About Brian F. Goetz

Brian Goetz is a software consultant with twenty years industry experience, with over 75 articles on Java development. He is one of the primary members of the Java Community Process JSR 166 Expert Group (Concurrency Utilities), and has served on numerous other JCP Expert Groups.Tim Peierls is the very model of a modern multiprocessor, with BoxPop.biz, recording arts, and goings on theatrical. He is one of the primary members of the Java Community Process JSR 166 Expert Group (Concurrency Utilities), and has served on numerous other JCP Expert Groups.Joshua Bloch is a principal engineer at Google and a Jolt Award-winner. He was previously a distinguished engineer at Sun Microsystems and a senior systems designer at Transarc. Josh led the design and implementation of numerous Java platform features, including JDK 5.0 language enhancements and the award-winning Java Collections Framework. He holds a Ph.D. in computer science from Carnegie Mellon University.Joseph Bowbeer is a software architect at Vizrea Corporation where he specializes in mobile application development for the Java ME platform, but his fascination with concurrent programming began in his days at Apollo Computer. He served on the JCP Expert Group for JSR-166 (Concurrency Utilities).David Holmes is director of DLTeCH Pty Ltd, located in Brisbane, Australia. He specializes in synchronization and concurrency and was a member of the JSR-166 expert group that developed the new concurrency utilities. He is also a contributor to the update of the Real-Time Specification for Java, and has spent the past few years working on an implementation of that specification.Doug Lea is one of the foremost experts on object-oriented technology and software reuse. He has been doing collaborative research with Sun Labs for more than five years. Lea is Professor of Computer Science at SUNY Oswego, Co-director of the Software Engineering Lab at the New York Center for Advanced Technology in Computer Applications, and Adjunct Professor of Electrical and Computer Engineering at Syracuse University. In addition, he co-authored the book, Object-Oriented System Development (Addison-Wesley, 1993). He received his B.A., M.A., and Ph.D. from the University of New Hampshire.show more

Table of contents

Listings xiiPreface xviiChapter 1: Introduction 11.1 A (very) brief history of concurrency 11.2 Benefits of threads 31.3 Risks of threads 51.4 Threads are everywhere 9Part I: Fundamentals 13Chapter 2: Thread Safety 152.1 What is thread safety? 172.2 Atomicity 192.3 Locking 232.4 Guarding state with locks 272.5 Liveness and performance 29Chapter 3: Sharing Objects 333.1 Visibility 333.2 Publication and escape 393.3 Thread confinement 423.4 Immutability 463.5 Safepublication 49Chapter 4: Composing Objects 554.1 Designing a thread-safe class 554.2 Instance confinement 584.3 Delegating thread safety 624.4 Adding functionality to existing thread-safe classes 714.5 Documenting synchronization policies 74Chapter 5: Building Blocks 795.1 Synchronized collections 795.2 Concurrent collections 845.3 Blocking queues and the producer-consumer pattern 875.4 Blocking and interruptible methods 925.5 Synchronizers 945.6 Building an efficient, scalable result cache 101Part II: Structuring Concurrent Applications 111Chapter 6: Task Execution 1136.1 Executing tasks in threads 1136.2 The Executor framework 1176.3 Finding exploitable parallelism 123Chapter 7: Cancellation and Shutdown 1357.1 Task cancellation 1357.2 Stopping a thread-based service 1507.3 Handling abnormal thread termination 1617.4 JVM shutdown 164Chapter 8: Applying Thread Pools 1678.1 Implicit couplings between tasks and execution policies 1678.2 Sizing thread pools 1708.3 Configuring ThreadPoolExecutor 1718.4 Extending ThreadPoolExecutor 1798.5 Parallelizing recursive algorithms 181Chapter 9: GUI Applications 1899.1 Why are GUIs single-threaded? 1899.2 Short-running GUI tasks 1929.3 Long-running GUI tasks 1959.4 Shared data models 1989.5 Other forms of single-threaded subsystems 202Part III: Liveness, Performance, and Testing 203Chapter 10: Avoiding Liveness Hazards 20510.1 Deadlock 20510.2 Avoiding and diagnosing deadlocks 21510.3 Other liveness hazards 218Chapter 11: Performance and Scalability 22111.1 Thinking about performance 22111.2 Amdahl's law 22511.3 Costs introduced by threads 22911.4 Reducing lock contention 23211.5 Example: Comparing Map performance 24211.6 Reducing context switch overhead 243Chapter 12: Testing Concurrent Programs 24712.1 Testing for correctness 24812.2 Testing for performance 26012.3 Avoiding performance testing pitfalls 26612.4 Complementary testing approaches 270Part IV: Advanced Topics 275Chapter 13: Explicit Locks 27713.1 Lock and ReentrantLock 27713.2 Performance considerations 28213.3 Fairness 28313.4 Choosing between synchronized and ReentrantLock 28513.5 Read-write locks 286Chapter 14: Building Custom Synchronizers 29114.1 Managing state dependence 29114.2 Using condition queues 29814.3 Explicit condition objects 30614.4 Anatomy of a synchronizer 30814.5 AbstractQueuedSynchronizer 31114.6 AQS in java.util.concurrent synchronizer classes 314Chapter15: Atomic Variables and Nonblocking Synchronization 31915.1 Disadvantages of locking 31915.2 Hardware support for concurrency 32115.3 Atomic variable classes 32415.4 Nonblocking algorithms 329Chapter 16: The Java Memory Model 33716.1 What is a memory model, and why would I want one? 33716.2 Publication 34416.3 Initialization safety 349Appendix A: Annotations for Concurrency 353A.1 Class annotations 353A.2 Field andmethod annotations 353Bibliography 355Index 359show more

Rating details

1,788 ratings
4.41 out of 5 stars
5 56% (1,007)
4 32% (575)
3 9% (155)
2 2% (39)
1 1% (12)

Our customer reviews

One of the best books written on the subject. Clear explanations of advanced concepts are supported by good examples. Highly recommended.show more
by Bulent Kucuk
This book is good for experienced Java programmers. However the first chapter s can be read by "beginners". The book is written in a good pedagogic manner. All the topics are explained well giving both the knowledge and deep understanding. The authors know very well both the subject and how to introduce it to the reader. By the end of the book the reader understands what problems arise when building concurrent application and different strategies for building good applications with maximum scalability and performance. There are a lot of examples - both of a "bad" and a "good" code. Last chapters of the book focus on how concurrency supporting mechanism was build in Java 5. This was interesting for me to read them, not sure whether I will use these advanced topics a lot.show more
by Artiom Gourevitch
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X