"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 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 Model
Cited By
- Sun C, Dai H, Geng N, Liu H, Chen T, Wu P, Cai Y and Wang J (2023). An Interleaving Guided Metamorphic Testing Approach for Concurrent Programs, ACM Transactions on Software Engineering and Methodology, 33:1, (1-21), Online publication date: 31-Jan-2024.
- Chen S, Lin Z and Zhang Y Controlled data races in enclaves Proceedings of the 32nd USENIX Conference on Security Symposium, (4069-4086)
- Costea A, Tiwari A, Chianasta S, R K, Roychoudhury A and Sergey I (2023). Hippodrome: Data Race Repair Using Static Analysis Summaries, ACM Transactions on Software Engineering and Methodology, 32:2, (1-33), Online publication date: 30-Apr-2023.
- Mazzonetto A, Frantz R, Sawicki S, Roos-Frantz F and Battisti G (2023). Towards a dynamic heuristic for task scheduling in application integration platforms to handle large volumes of data, The Journal of Supercomputing, 79:1, (998-1031), Online publication date: 1-Jan-2023.
- Basile D and ter Beek M A Clean and Efficient Implementation of Choreography Synthesis for Behavioural Contracts Coordination Models and Languages, (225-238)
- Basile D, ter Beek M, Degano P, Legay A, Ferrari G, Gnesi S and Di Giandomenico F Supervisory Synthesis of Configurable Behavioural Contracts with Modalities Formal Techniques for Distributed Objects, Components, and Systems, (177-181)
- Wang H, Wang Z, Sun J, Liu S, Sadiq A and Li Y Towards generating thread-safe classes automatically Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering, (943-955)
- Leroy D, Bousse E, Wimmer M, Mayerhofer T, Combemale B and Schwinger W (2020). Behavioral interfaces for executable DSLs, Software and Systems Modeling (SoSyM), 19:4, (1015-1043), Online publication date: 1-Jul-2020.
- Lessley B and Childs H (2019). Data-Parallel Hashing Techniques for GPU Architectures, IEEE Transactions on Parallel and Distributed Systems, 31:1, (237-250), Online publication date: 1-Jan-2020.
- Wang Z, Zhao Y, Liu S, Sun J, Chen X and Lin H MAP-Coverage Proceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering, (722-734)
- Gabbrielli M, Giallorenzo S, Lanese I, Montesi F, Peressotti M and Zingaro S No More, No Less Coordination Models and Languages, (148-157)
- Nguyen H, Nguyen T, Dig D, Nguyen S, Tran H and Hilton M Graph-based mining of in-the-wild, fine-grained, semantic code change patterns Proceedings of the 41st International Conference on Software Engineering, (819-830)
- Offutt J and Thummala S (2019). Testing concurrent user behavior of synchronous web applications with Petri nets, Software and Systems Modeling (SoSyM), 18:2, (913-936), Online publication date: 1-Apr-2019.
- Voss C, Cogumbreiro T and Sarkar V Transitive joins Proceedings of the 24th Symposium on Principles and Practice of Parallel Programming, (378-390)
- Daloze B, Tal A, Marr S, Mössenböck H and Petrank E (2018). Parallelization of dynamic languages: synchronizing built-in collections, Proceedings of the ACM on Programming Languages, 2:OOPSLA, (1-30), Online publication date: 24-Oct-2018.
- Lin H, Wang Z, Liu S, Sun J, Zhang D and Wei G PFix: fixing concurrency bugs based on memory access patterns Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, (589-600)
- Papadakis G, Bereta K, Palpanas T and Koubarakis M Multi-core Meta-blocking for Big Linked Data Proceedings of the 13th International Conference on Semantic Systems, (33-40)
- Fachada N, Lopes V, Martins R and Rosa A (2017). Parallelization Strategies for Spatial Agent-Based Models, International Journal of Parallel Programming, 45:3, (449-481), Online publication date: 1-Jun-2017.
- Fachada N and Rosa A Assessing the feasibility of OpenCL CPU implementations for agent-based simulations Proceedings of the 5th International Workshop on OpenCL, (1-10)
- Tosi Z and Yoshimi J (2016). Simbrain 3.0, Neural Networks, 83:C, (1-10), Online publication date: 1-Nov-2016.
- Zakkak F and Pratikakis P DiSquawk Proceedings of the 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools, (1-12)
- Ernst M, Macedonio D, Merro M and Spoto F Semantics for Locking Specifications Proceedings of the 8th International Symposium on NASA Formal Methods - Volume 9690, (355-372)
- Ernst M, Lovato A, Macedonio D, Spoto F and Thaine J Locking discipline inference and checking Proceedings of the 38th International Conference on Software Engineering, (1133-1144)
- Terragni V and Cheung S Coverage-driven test code generation for concurrent classes Proceedings of the 38th International Conference on Software Engineering, (1121-1132)
- Hofer P, Gnedt D, Schörgenhumer A and Mössenböck H Efficient Tracing and Versatile Analysis of Lock Contention in Java Applications on the Virtual Machine Level Proceedings of the 7th ACM/SPEC on International Conference on Performance Engineering, (263-274)
- Gramoli V (2015). More than you ever wanted to know about synchronization: synchrobench, measuring the impact of the synchronization on concurrent algorithms, ACM SIGPLAN Notices, 50:8, (1-10), Online publication date: 18-Dec-2015.
- Pinto G, Torres W and Castor F A study on the most popular questions about concurrent programming Proceedings of the 6th Workshop on Evaluation and Usability of Programming Languages and Tools, (39-46)
- Dietrich J, Tandler J, Sui L and Meyer M The PrimeGame Revolutions Proceedings of the ASWEC 2015 24th Australasian Software Engineering Conference, (8-12)
- Lin Y and Dig D (2015). A study and toolkit of CHECK-THEN-ACT idioms of Java concurrent collections, Software Testing, Verification & Reliability, 25:4, (397-425), Online publication date: 1-Jun-2015.
- Haque M, Eom Y, He Y, Elnikety S, Bianchini R and McKinley K (2015). Few-to-Many, ACM SIGARCH Computer Architecture News, 43:1, (161-175), Online publication date: 29-May-2015.
- Haque M, Eom Y, He Y, Elnikety S, Bianchini R and McKinley K (2015). Few-to-Many, ACM SIGPLAN Notices, 50:4, (161-175), Online publication date: 12-May-2015.
- Haque M, Eom Y, He Y, Elnikety S, Bianchini R and McKinley K Few-to-Many Proceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems, (161-175)
- Patros P, Aubanel E, Bremner D and Dawson M A Java util concurrent park contention tool Proceedings of the Sixth International Workshop on Programming Models and Applications for Multicores and Manycores, (106-111)
- Gramoli V More than you ever wanted to know about synchronization: synchrobench, measuring the impact of the synchronization on concurrent algorithms Proceedings of the 20th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, (1-10)
- Kaiser A, Kroening D and Wahl T (2014). A Widening Approach to Multithreaded Program Verification, ACM Transactions on Programming Languages and Systems, 36:4, (1-29), Online publication date: 28-Oct-2014.
- Smith J, Stephen D, Lesman A and Pratt J Real-Time control of Humanoid Robots using OpenJDK Proceedings of the 12th International Workshop on Java Technologies for Real-time and Embedded Systems, (29-36)
- Richardson T, Burd L and Smith S (2014). Guidelines for supporting real-time multi-touch applications, Software—Practice & Experience, 44:8, (931-949), Online publication date: 1-Aug-2014.
- Gramoli V and Santosa A Why inheritance anomaly is not worth solving Proceedings of the 9th International Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems PLE, (1-12)
- Muscar A Programming Safe Agents in Blueprint Proceedings of the 4th International Conference on Web Intelligence, Mining and Semantics (WIMS14), (1-10)
- Hayashi A, Grossman M, Zhao J, Shirako J and Sarkar V Accelerating Habanero-Java programs with OpenCL generation Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools, (124-134)
- McCabe F and Sperber M Feel different on the Java platform Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools, (89-100)
- Kolesnichenko A, Nanz S and Meyer B How to Cancel a Task Proceedings of the International Conference on Multicore Software Engineering, Performance, and Tools - Volume 8063, (61-72)
- Nandivada V, Shirako J, Zhao J and Sarkar V (2013). A Transformation Framework for Optimizing Task-Parallel Programs, ACM Transactions on Programming Languages and Systems, 35:1, (1-48), Online publication date: 1-Apr-2013.
- Demange D, Laporte V, Zhao L, Jagannathan S, Pichardie D and Vitek J (2013). Plan B, ACM SIGPLAN Notices, 48:1, (329-342), Online publication date: 23-Jan-2013.
- Demange D, Laporte V, Zhao L, Jagannathan S, Pichardie D and Vitek J Plan B Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (329-342)
- Sewe A, Mezini M, Sarimbekov A, Ansaloni D, Binder W, Ricci N and Guyer S (2012). new Scala() instance of Java, ACM SIGPLAN Notices, 47:11, (97-108), Online publication date: 8-Jan-2013.
- Okur S and Dig D How do developers use parallel libraries? Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, (1-11)
- Silva J and Lins R ooErlang Proceedings of the eleventh ACM SIGPLAN workshop on Erlang workshop, (65-66)
- Kaiser A, Kroening D and Wahl T Efficient coverability analysis by proof minimization Proceedings of the 23rd international conference on Concurrency Theory, (500-515)
- Pradel M and Gross T (2012). Fully automatic and precise detection of thread safety violations, ACM SIGPLAN Notices, 47:6, (521-530), Online publication date: 6-Aug-2012.
- Shirako J, Vrvilo N, Mercer E and Sarkar V Design, verification and applications of a new read-write lock algorithm Proceedings of the twenty-fourth annual ACM symposium on Parallelism in algorithms and architectures, (48-57)
- Sewe A, Mezini M, Sarimbekov A, Ansaloni D, Binder W, Ricci N and Guyer S new Scala() instance of Java Proceedings of the 2012 international symposium on Memory Management, (97-108)
- Pradel M and Gross T Fully automatic and precise detection of thread safety violations Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, (521-530)
- Gudka K, Harris T and Eisenbach S Lock inference in the presence of large libraries Proceedings of the 26th European conference on Object-Oriented Programming, (308-332)
- Grossman D and Anderson R Introducing parallelism and concurrency in the data structures course Proceedings of the 43rd ACM technical symposium on Computer Science Education, (505-510)
- Goto M, Jagadeesan R, Ptcher C and Riely J Types for relaxed memory models Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation, (25-38)
- Ansaloni D, Binder W, Moret P and Villazón A Dynamic aspect-oriented programming in java Transactions on Aspect-Oriented Software Development IX, (92-122)
- Gramoli V and Guerraoui R Democratizing transactional programming Proceedings of the 12th International Middleware Conference, (1-19)
- Gramoli V and Guerraoui R Democratizing transactional programming Proceedings of the 12th ACM/IFIP/USENIX international conference on Middleware, (1-19)
- Shacham O, Bronson N, Aiken A, Sagiv M, Vechev M and Yahav E Testing atomicity of composed concurrent operations Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications, (51-64)
- Shacham O, Bronson N, Aiken A, Sagiv M, Vechev M and Yahav E (2011). Testing atomicity of composed concurrent operations, ACM SIGPLAN Notices, 46:10, (51-64), Online publication date: 18-Oct-2011.
- Sumner W, Hammer C and Dolby J Marathon Proceedings of the Second international conference on Runtime verification, (161-176)
- Wellings A, Lin S and Burns A Resource sharing in RTSJ and SCJ systems Proceedings of the 9th International Workshop on Java Technologies for Real-Time and Embedded Systems, (11-19)
- Peternier A, Bonetta D, Binder W and Pautasso C Overseer Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, (143-146)
- Cavé V, Zhao J, Shirako J and Sarkar V Habanero-Java Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, (51-61)
- Kozuka N and Ishida Y Building a product line architecture for variant-rich enterprise applications using a data-oriented approach Proceedings of the 15th International Software Product Line Conference, Volume 2, (1-6)
- Ishizaki K, Daijavad S and Nakatani T Refactoring Java programs using concurrent libraries Proceedings of the Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, (35-44)
- Donaldson A, Kaiser A, Kroening D and Wahl T Symmetry-aware predicate abstraction for shared-variable concurrent programs Proceedings of the 23rd international conference on Computer aided verification, (356-371)
- Shirako J, Sharma K and Sarkar V Unifying barrier and point-to-point synchronization in OpenMP with phasers Proceedings of the 7th international conference on OpenMP in the Petascale era, (122-137)
- Schäfer M, Sridharan M, Dolby J and Tip F Refactoring Java programs for flexible locking Proceedings of the 33rd International Conference on Software Engineering, (71-80)
- Kjolstad F, Dig D, Acevedo G and Snir M Transformation for class immutability Proceedings of the 33rd International Conference on Software Engineering, (61-70)
- Dig D, Marrero J and Ernst M How do programs become more concurrent Proceedings of the 4th International Workshop on Multicore Software Engineering, (43-50)
- Cicirelli F, Furfaro A, Giordano A and Nigro L Performance of a multi-agent system over a multi-core cluster managed by Terracotta Proceedings of the 2011 Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, (125-133)
- Naderlinger A, Templ J, Resmerita S and Pree W An asynchronous Java interface to MATLAB Proceedings of the 4th International ICST Conference on Simulation Tools and Techniques, (57-62)
- Gross T Breadth in depth Proceedings of the 42nd ACM technical symposium on Computer science education, (435-440)
- Ortiz A Teaching concurrency-oriented programming with Erlang Proceedings of the 42nd ACM technical symposium on Computer science education, (195-200)
- Ernst M and Ali M Building and using pluggable type systems Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering, (375-376)
- Bonetta D, Peternier A, Pautasso C and Binder W Towards scalable service composition on multicores Proceedings of the 2010 international conference on On the move to meaningful internet systems, (655-664)
- Black A, Bruce K and Noble J Panel Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, (201-204)
- Grossman M, Sbîrlea A, Budimlić Z and Sarkar V CnC-CUDA Proceedings of the 23rd international conference on Languages and compilers for parallel computing, (230-245)
- Kim K, Yavuz-Kahveci T and Sanders B JRF-E Proceedings of the 25th IEEE/ACM International Conference on Automated Software Engineering, (215-224)
- Budimlić Z, Burke M, Cavé V, Knobe K, Lowney G, Newton R, Palsberg J, Peixotto D, Sarkar V, Schlimbach F and Taşırlar S (2010). Concurrent Collections, Scientific Programming, 18:3-4, (203-217), Online publication date: 1-Aug-2010.
- Qi Y, Nir-Buchbinder Y, Farchi E, Das R, Luo Z and Gan Z Unit testing for concurrent business code Proceedings of the 8th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, (37-47)
- Brown R, Shoop E, Adams J, Clifton C, Gardner M, Haupt M and Hinsbeeck P Strategies for preparing computer science students for the multicore world Proceedings of the 2010 ITiCSE working group reports, (97-115)
- Yahav E and Sagiv M (2008). Verifying safety properties of concurrent heap-manipulating programs, ACM Transactions on Programming Languages and Systems, 32:5, (1-50), Online publication date: 1-May-2010.
- Spoto F The nullness analyser of JULIA Proceedings of the 16th international conference on Logic for programming, artificial intelligence, and reasoning, (405-424)
- Ansaloni D, Binder W, Villazón A and Moret P Parallel dynamic analysis on multicores with aspect-oriented programming Proceedings of the 9th International Conference on Aspect-Oriented Software Development, (1-12)
- Binder W, Villazón A, Ansaloni D and Moret P @J Proceedings of the Third Workshop on Virtual Machines and Intermediate Languages, (1-9)
- Barik R, Budimlic Z, Cavè V, Chatterjee S, Guo Y, Peixotto D, Raman R, Shirako J, Taşırlar S, Yan Y, Zhao Y and Sarkar V The habanero multicore software research project Proceedings of the 24th ACM SIGPLAN conference companion on Object oriented programming systems languages and applications, (735-736)
- Bunde D (2009). A short unit to introduce multi-threaded programming, Journal of Computing Sciences in Colleges, 25:1, (9-20), Online publication date: 1-Oct-2009.
- Brauer J, Schlich B and Kowalewski S (2009). Parallel and Distributed Invariant Checking of Microcontroller Software, Electronic Notes in Theoretical Computer Science (ENTCS), 254, (45-63), Online publication date: 1-Oct-2009.
- Zeng F Pattern-driven deadlock avoidance Proceedings of the 7th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, (1-8)
- Petrank E, Musuvathi M and Steesngaard B Progress guarantee for parallel programs via bounded lock-freedom Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, (144-154)
- Petrank E, Musuvathi M and Steesngaard B (2009). Progress guarantee for parallel programs via bounded lock-freedom, ACM SIGPLAN Notices, 44:6, (144-154), Online publication date: 28-May-2009.
- Dig D, Marrero J and Ernst M Refactoring sequential Java code for concurrency via concurrent libraries Proceedings of the 31st International Conference on Software Engineering, (397-407)
- Fekete A (2009). Teaching about threading, ACM SIGACT News, 40:1, (51-57), Online publication date: 28-Feb-2009.
- Dantas A Improving developers' confidence in test results of multi-threaded systems Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications, (899-900)
- Ispir M and Betin Can A An Assume Guarantee Verification Methodology for Aspect-Oriented Programming Proceedings of the 23rd IEEE/ACM International Conference on Automated Software Engineering, (391-394)
- Rogers I, Zhao J, Kirkham C and Watson I Constraint based optimization of stationary fields Proceedings of the 6th international symposium on Principles and practice of programming in Java, (95-104)
- Fekete A (2008). Teaching students to develop thread-safe java classes, ACM SIGCSE Bulletin, 40:3, (119-123), Online publication date: 25-Aug-2008.
- Letko Z, Vojnar T and Křena B AtomRace Proceedings of the 6th workshop on Parallel and distributed systems: testing, analysis, and debugging, (1-10)
- Bodden E and Havelund K Racer Proceedings of the 2008 international symposium on Software testing and analysis, (155-166)
- Flanagan C, Freund S, Lifshin M and Qadeer S (2008). Types for atomicity, ACM Transactions on Programming Languages and Systems, 30:4, (1-53), Online publication date: 1-Jul-2008.
- Fekete A Teaching students to develop thread-safe java classes Proceedings of the 13th annual conference on Innovation and technology in computer science education, (119-123)
- Hammer C, Dolby J, Vaziri M and Tip F Dynamic detection of atomic-set-serializability violations Proceedings of the 30th international conference on Software engineering, (231-240)
- Zeng L, Lei H and Chang H Monitoring the QoS for Web Services Proceedings of the 5th international conference on Service-Oriented Computing, (132-144)
- Aspinall D and Ševčík J Formalising java's data race free guarantee Proceedings of the 20th international conference on Theorem proving in higher order logics, (22-37)