Skip to Content
Java Concurrency in Practice
book

Java Concurrency in Practice

by Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea
May 2006
Intermediate to advanced
432 pages
12h 21m
English
Addison-Wesley Professional
Content preview from Java Concurrency in Practice

Chapter 2. Thread Safety

Perhaps surprisingly, concurrent programming isn't so much about threads or locks, any more than civil engineering is about rivets and I-beams. Of course, building bridges that don't fall down requires the correct use of a lot of rivets and I-beams, just as building concurrent programs require the correct use of threads and locks. But these are just mechanisms—means to an end. Writing thread-safe code is, at its core, about managing access to state, and in particular to shared, mutable state.

Informally, an object's state is its data, stored in state variables such as instance or static fields. An object's state may include fields from other, dependent objects; a HashMap's state is partially stored in the HashMap object ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Concurrency and Multithreading in Practice

Java Concurrency and Multithreading in Practice

Tatiana Fesenko
Modern Concurrency in Java

Modern Concurrency in Java

A N M Bazlur Rahman
Java Concurrency, 2/e

Java Concurrency, 2/e

Douglas Schmidt
Modern Java in Action

Modern Java in Action

Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft

Publisher Resources

ISBN: 0321349601Purchase book