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]
The Three-Body Problem
Book Review
The Three-Body Problem" by Liu Cixin is a thought-provoking science fiction masterpiece that transcends the boundaries of traditional storytelling. Set against the backdrop of China’s Cultural Revolution and the enigmatic mysteries of the cosmos, Liu Cixin weaves a narrative that challenges conventional perceptions of humanity’s place in the universe while delving into complex themes of technology, morality, and the nature of existence itself.
The novel opens with Ye Wenjie, a young astrophysicist whose father’s wrongful death during the Cultural Revolution shapes her disillusionment with humanity and fuels her desire to escape Earth’s constraints.
[Read More]
Two Pointers - Coding Interview Patterns
Coding Interview Patterns
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]
The Thursday Murder Club
Book Review
Richard Osman’s debut novel, “The Thursday Murder Club”, is a delightful blend of mystery, humor, and heartwarming camaraderie that keeps readers engaged from start to finish. Set in a retirement village, the novel introduces a group of seniors who form the Thursday Murder Club, a gathering where they discuss unsolved crimes. However, when a real murder occurs on their doorstep, they find themselves embroiled in a thrilling investigation that challenges their wit, wisdom, and friendships.
[Read More]
Everyone in My Family Has Killed Someone
Book Review
Everyone in My Family has killed someone by Benjamin Stevenson is one of the few books that I have read follows the “Play Fair” mystery. A “play fair” mystery is one that includes all the clues necessary for the reader to solve it. They involve the reader in a game as well as entertaining him or her with a gripping story. In the beginning itself, writer lists down all the rules that he will abide by and since write himself is a narrator that makes the writing all the more exciting.
[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.