This blog post is a collection of articles about threads, locks and concurrency.
Some context
I’ve had a lot of time to kill in the last few weeks so I recently completed a series of 3 classes, a specialization, on Coursera — Parallel, Concurrent, and Distributed Programming in Java Specialization.
The first two classes, Parallel Programming in Java and Concurrent Programming in Java were good revisions of material I had studied in one of my computer engineering classes at Purdue exactly an year ago. In the Distributed Programming in Java class I used Hadoop and Spark for the first time and revised more material related to networking and about different approaches to combine distribution with multithreading that I had learned in my classes at Purdue. This class was mostly about high-level abstractions and frameworks that are useful in distributed systems.
In the Concurrent Programming class I found various articles listed under the ‘Optional Reading’ section that were extremely resourceful. In college I had studied concurrency in my computer architecture class. I had referred to the textbook and my professor’s slides. I don’t have that course textbook or my professor’s slides anymore. So I’ve made this list of articles to be my go-to resource for fundamentals of concurrency.
The list
Threads
Structured Locks
Unstructured Locks
Liveness
- Wikipedia article on Deadlock and Livelock
- Java examples of deadlock due to synchronized methods and starvation and livelock
Critical sections
Object-Based Isolation
Atomic Variables in Java
- Tutorial on Atomic Integers in Java
- Article in Java theory and practice series on Going atomic.
- “By exposing new low-level coordination primitives internally, and providing a set of public atomic variable classes, it now becomes practical, for the first time, to develop wait-free, lock-free algorithms in the Java language.”
- Wikipedia article on Atomic Wrapper Classes in Java
Read-Write Isolation
Optimistic Concurrency and some Java data structures
- Wikipedia article on Optimistic concurrency control
- java.util.concurrent.*
Linearizability
Miscellanious
- Dining philosophers problem: an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them