Back to Home11/14/2025, 5:52:51 AM

Ask HN: How to learn concurrency?

41 points
19 comments

Mood

thoughtful

Sentiment

positive

Category

tech

Key topics

concurrency

programming

java

Debate intensity20/100
Race condition, producer consumer, and cool stuffs like that? I do java

The author is seeking advice on how to learn about concurrency, specifically in Java, and is looking for resources to understand concepts like race conditions and producer-consumer problems.

Snapshot generated from the HN discussion

Discussion Activity

Active discussion

First comment

14m

Peak period

15

Day 1

Avg / period

8

Comment distribution16 data points

Based on 16 loaded comments

Key moments

  1. 01Story posted

    11/14/2025, 5:52:51 AM

    5d ago

    Step 01
  2. 02First comment

    11/14/2025, 6:07:09 AM

    14m after posting

    Step 02
  3. 03Peak activity

    15 comments in Day 1

    Hottest window of the conversation

    Step 03
  4. 04Latest activity

    11/17/2025, 9:16:48 AM

    2d ago

    Step 04

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (19 comments)
Showing 16 comments of 19
scorpioxy
5d ago
1 reply
That's a huge topic but I would say implement a hobby project and learn by doing. Pick something you're interested in and start writing code to exercise the theoretical concepts.

A small piece of advice is to make sure you're motivated before diving in. Debugging a race condition, just as an example, can be quite involved and consume a lot of your time and energy to even reproduce.

ykonstant
5d ago
1 reply
But what is a good hobby project with a strong focus on concurrency that will not swamp a beginner to this topic?
peauc
5d ago
I started by writing a user interface that handled they keyboard events in a thread and communicated to the main thread using a message queue. IMO that's a good easy first step :)
rramadass
4d ago
1 reply
1) Foundations of Multithreaded, Parallel, and Distributed Programming by Gregory Andrews - https://www2.cs.arizona.edu/~greg/mpdbook/ This will give you a solid foundation in all aspects of concurrency.

2) The Art of Multiprocessor Programming by Herlihy, Shavit et al. - https://shop.elsevier.com/books/the-art-of-multiprocessor-pr... The classic must-study book.

Both the above are not language specific but do have examples in Java.

Cwizard
2d ago
I read the “The Art of Multiprocessor Programming” and I don’t recommend it. It is very theoretical. There is no mention of practical performance considerations on real hardware.

Large parts of the theory focus on lock-free and wait-free data structures. Which, while interesting, are not necessary for beginners.

another_twist
4d ago
Docs of java.util.concurrent would be my suggestion. And go straight into the wild and try to build a system that solves the billion rows challenge. You might want to truncate the input and start with a million row challenge first.

The cool stuff in concurrency is not having to deal with it imoand recognizing when its not essential. Also I hope you mean concurrency not parallelism. The second one is a bit more manageable.

ashed96
4d ago
Once you've gone through the learning resources others shared, LeetCode has a dedicated concurrency section for hands-on practice: https://leetcode.com/problemset/concurrency/

(I actually authored a few of those problems - they cover the classic scenarios like producer-consumer, dining philosophers, etc.)

Rendello
5d ago
Everything I know is from desperately trying to parallelize my TIS-100 solutions.
sigmaprimus
5d ago
Brilliant.org?
notorious_pgb
4d ago
Do you know, deep down, what a thread is? What it actually is?

If not, I suggest reading this blog post: https://prettygoodblog.com/p/what-threads-are-part-2

(disclaimer: I wrote this)

Pooge
5d ago
Java Concurrency in Practice[1] has always been recommended by my colleagues. I'm about halfway through it and I think it makes the concepts pretty clear. Even if you move away from Java one day, I think the investment is not lost at all. Then you could ask your favorite LLM to create concurrency exercises once in a while to practice.

[1]: ISBN 978-0321349606

throwaway81523
5d ago
Read a book about OS's I guess. This should be good, an update of an earlier good book: https://www.os-book.com/OS10/

There was a Java-specific edition: https://www.os-book.com/OS8/os8j/index.html

liampulles
5d ago
Something I've built for myself (in Go) that has been extremely useful is a lib to read a CSV that delegates to n concurrent workers.

Maybe that is a good side project.

luhego
4d ago
If you don’t mind learning another language. I have found Learn Concurrent Programming with Go by James Cutajar to be a very practical book. It includes memory sharing and message passing approaches with plenty of examples. It also explains concepts like mutual exclusion, deadlock-free and starvation-free properties and others. For Java, you can try The Art of Multiprocessor Programming Second Edition. It includes examples in Java but it is more theoretical and it includes a lot of proofs, specially the first half. The second half is more approachable.

3 more comments available on Hacker News

ID: 45924262Type: storyLast synced: 11/16/2025, 9:43:00 PM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.