Java Concurrency in Practice

By Brian Goetz

"I used to be lucky certainly to have labored with an exquisite staff at the layout and implementation of the concurrency gains further to the Java platform in Java 5.0 and Java 6. Now this related group offers the easiest clarification but of those new good points, and of concurrency quite often. Concurrency is not any longer a subject matter for complicated clients merely. each Java developer should still learn this book."
--Martin Buchholz
JDK Concurrency Czar, sunlight Microsystems

"For the earlier 30 years, desktop functionality has been pushed via Moore's legislation; any longer, will probably be pushed through Amdahl's legislations. Writing code that successfully exploits a number of processors may be very hard. Java Concurrency in Practice provide you with the thoughts and strategies had to write secure and scalable Java courses for today's--and tomorrow's--systems."
--Doron Rajwan
Research Scientist, Intel Corp

"This is the ebook you wish in case you are writing--or designing, or debugging, or holding, or contemplating--multithreaded Java courses. If you have ever needed to synchronize a style and also you were not certain why, you owe it to your self and your clients to learn this publication, hide to cover."
--Ted Neward
Author of Effective firm Java

"Brian addresses the elemental concerns and complexities of concurrency with unusual readability. This publication is a must-read for a person who makes use of threads and cares approximately performance."
--Kirk Pepperdine
CTO, JavaPerformanceTuning.com

"This e-book covers a really deep and refined subject in a truly transparent and concise means, making it the ideal Java Concurrency reference guide. each one web page is full of the issues (and solutions!) that programmers fight with on a daily basis. successfully exploiting concurrency is turning into a growing number of vital now that Moore's legislation is providing extra cores yet now not quicker cores, and this booklet will provide help to do it."
--Dr. Cliff Click
Senior software program Engineer, Azul Systems

"I have a robust curiosity in concurrency, and feature most likely written extra thread deadlocks and made extra synchronization error than such a lot programmers. Brian's e-book is the main readable concerning threading and concurrency in Java, and bargains with this hard topic with a superb hands-on procedure. it is a booklet i'm recommending to all my readers of The Java experts' Newsletter, since it is attention-grabbing, valuable, and suitable to the issues dealing with Java builders today."
--Dr. Heinz Kabutz
The Java experts' Newsletter

"I've concentrated a profession on simplifying easy difficulties, yet this booklet ambitiously and successfully works to simplify a fancy yet serious topic: concurrency. Java Concurrency in Practice is progressive in its method, delicate and simple well-liked, and well timed in its delivery--it's destined to be a crucial book."
--Bruce Tate
Author of Beyond Java

" Java Concurrency in Practice is a useful compilation of threading information for Java builders. i discovered analyzing this publication intellectually intriguing, partly since it is a superb creation to Java's concurrency API, yet regularly since it captures in an intensive and available means specialist wisdom on threading now not simply chanced on elsewhere."
--Bill Venners
Author of Inside the Java digital Machine

Threads are a primary a part of the Java platform. As multicore processors turn into the norm, utilizing concurrency successfully turns into crucial for construction high-performance purposes. Java SE five and six are an enormous breakthrough for the improvement of concurrent functions, with advancements to the Java digital desktop to aid high-performance, hugely scalable concurrent periods and a wealthy set of recent concurrency development blocks. In Java Concurrency in Practice , the creators of those new amenities clarify not just how they paintings and the way to take advantage of them, but in addition the incentive and layout styles in the back of them.

However, constructing, trying out, and debugging multithreaded courses can nonetheless be very tricky; it's all too effortless to create concurrent courses that seem to paintings, yet fail while it concerns so much: in creation, lower than heavy load. Java Concurrency in Practice palms readers with either the theoretical underpinnings and urban thoughts for construction trustworthy, scalable, maintainable concurrent functions. instead of easily providing a listing of concurrency APIs and mechanisms, it presents layout principles, styles, and psychological types that help you construct concurrent courses which are either right and performant.

This ebook covers:

  • simple innovations of concurrency and thread protection
  • Techniques for development and composing thread-safe periods
  • Using the concurrency development blocks in java.util.concurrent
  • Performance optimization dos and don'ts
  • Testing concurrent courses
  • Advanced subject matters corresponding to atomic variables, nonblocking algorithms, and the Java reminiscence Model

Show description

Preview of Java Concurrency in Practice PDF

Best Java books

OCA/OCP Java SE 7 Programmer I & II Study Guide (Exams 1Z0-803 & 1Z0-804) (Certification Press)

An entire examine procedure for OCA/OCP tests 1Z0-803 and 1Z0-804

Prepare for the OCA/OCP Java SE 7 Programmer I and II checks with this specific Oracle Press consultant. Chapters characteristic demanding routines, a certification precis, a two-minute drill, and a self-test to augment the subjects provided. This authoritative source is helping you go those tests and likewise serves as a vital, on-the-job reference.

Get entire assurance of all targets for tests 1Z0-803 and 1Z0-804, including:
• Declarations and entry control
• item orientation
• Assignments
• Operators
• Strings and arrays
• movement keep watch over and exceptions
• Assertions and Java 7 exceptions
• String processing, information formatting, and source bundles
• I/O and NIO
• complex OO and layout patterns
• Generics and collections
• internal classes
• Threads
• Concurrency
• Java Database Connectivity (JDBC)

Java: The Complete Reference, Ninth Edition

The Definitive Java Programming advisor totally up-to-date for Java SE eight, Java: the full Reference, 9th variation explains the right way to boost, assemble, debug, and run Java courses. Bestselling programming writer Herb Schildt covers the complete Java language, together with its syntax, key terms, and primary programming rules, in addition to major parts of the Java API library.

Java EE and HTML5 Enterprise Application Development (Oracle Press)

Create Next-Generation company purposes construct and distribute enterprise internet purposes that focus on either computing device and cellular units. Cowritten by way of Java EE and NetBeans IDE specialists, Java EE and HTML5 company software improvement totally explains state-of-the-art, hugely responsive layout instruments and methods.

Data Structures and the Java Collections Framework

Facts buildings and the Java Collections Framework, 2/e by means of William Collins teaches the basics of knowledge buildings utilizing java. This student-friendly ebook specializes in educating scholars find out how to observe the ideas awarded. thus many purposes and examples are integrated through the booklet.

Extra info for Java Concurrency in Practice

Show sample text content

Construction Blocks 86 a bit weakened to reflect the concurrent nature of the gathering. because the results of measurement may be old-fashioned by the point it really is computed, it truly is merely an estimate, so measurement is authorized to come an approximation rather than a precise count number. whereas at first this can look annoying, in truth equipment like dimension and isEmpty are some distance much less important in concurrent environments simply because those amounts are relocating pursuits. So the necessities for those operations have been weakened to let functionality optimizations for an important operations, basically get, placed, containsKey, and take away . the single function provided via the synchronized Map implementations yet now not through ConcurrentHashMap is the power to fasten the map for particular entry. With Hashtable and synchronizedMap, buying the Map lock prevents the other thread from getting access to it. this could be beneficial in strange situations similar to including numerous mappings atomically, or iterating the Map a number of occasions and wanting to determine an identical parts within the similar order. commonly, even though, it is a moderate tradeoff: concurrent collections might be anticipated to alter their contents always. since it has such a lot of benefits and so few dangers in comparison to Hashtable or synchronizedMap, changing synchronized Map implementations with ConcurrentHashMap in general effects in simple terms in higher scalability. provided that your software must lock the map for unique access3 is ConcurrentHashMap no longer a suitable drop-in alternative. five. 2. 2 extra atomic Map operations for the reason that a ConcurrentHashMap can't be locked for unique entry, we won't use client-side locking to create new atomic operations comparable to put-if-absent, as we did for Vector in part four. four. 1. as a substitute, a couple of universal compound operations similar to put-if-absent, remove-if-equal, and replace-if-equal are carried out as atomic operations and specified by means of the ConcurrentMap interface, proven in directory five. 7. in the event you find your self including such performance to an latest synchronized Map implementation, it truly is most likely an indication for you to think about using a ConcurrentMap in its place. five. 2. three CopyOnWriteArrayList CopyOnWriteArrayList is a concurrent alternative for a synchronized checklist that bargains larger concurrency in a few universal occasions and removes the necessity to lock or replica the gathering in the course of generation. (Similarly, CopyOnWriteArraySet is a concurrent alternative for a synchronized Set. ) The copy-on-write collections derive their thread security from the truth that so long as an successfully immutable item is correctly released, no additional synchronization is needed whilst having access to it. They enforce mutability by way of developing and republishing a brand new reproduction of the gathering whenever it truly is modified. Iterators for the copy-on-write collections preserve a connection with the backing array that used to be present initially of new release, and because it will by no means swap, they should three. Or while you are counting on the synchronization unwanted side effects of the synchronized Map implementations.

Download PDF sample

Rated 4.51 of 5 – based on 22 votes
This entry was posted in Java.