Java Concurrency In Practice - Chapter 2 Notes

Book Notes

Chapter 02 - Thread Safety What is thread-safety? Example - a stateless servlet Atomicity Race conditions Compound actions Locking Intrinsic locks Guarding state with locks Liveness & Performance Concurrency is more about achieving thread-safety, than it is about creating & managing threads. Those are mechanisms, but at its core, concurrency aims to encapsulate shared mutable state from uncontrolled concurrent access. Shared mutable state - properties of a class and/or properties of a dependent class (usually part of the class’ properties). [Read More]

Java Concurrency In Practice - Chapter 1 Notes

Book Notes

Chapter 01 - Introduction Brief history of concurrency Benefits of threads Risks of threads Safety hazards Liveness hazards Performance hazards Threads are everywhere Concurrency is the easiest way to leverage multiprocessor systems to exploit better performance. They are also inescapable in Java nowadays. E.g. Every time you’re making a Spring application, you are making a concurrent application. However, it makes writing programs a lot harder as now, programming constructs are not accessed in a sequential fashion. [Read More]

Learning about concurrency in Java

I have always wanted to explore concurrency in Java. This is my attempt to document my learnings as I start my journey to explore concurrency constructs and how to apply it in my day to day work. I am planning to start my journey by going through the book Java Concurrency in Practice by Brian Goetz and then exploring each of the construct in depth.