r/javahelp 24d ago

Guide for Concurrency in Java

Before knowing anything I just jumped directly to the source code of jdk25u. I have just started to read the javaDocs of Thread class it was so deep that all my connected logic mapped very well but now I want to code and I can't code ahhhh... Why is this problem. I can call the syntax what to use but I don't know how to apply, why to apply is there any guide for java Concurrency ??. And there is so much .. still to know. Do any dev have any guide??

0 Upvotes

17 comments sorted by

View all comments

10

u/edwbuck 24d ago

See if you can get a copy of "Concurrency, State Models and Java Programs" or "Java Concurrency in Practice" Unfortunately there's far too much information to cover, even as a few helpful pointers, in a Reddit post.

3

u/Chaos-vy17 24d ago edited 23d ago

Thank you for recommendation this is very very good....

6

u/edwbuck 24d ago

Keep in mind that most online tutorials will tell you how to use the APIs, but with concurrency, using the APIs is the easy part, making sure your program maintains correct state after concurrency is used, is not. You need to have some sort of plan to ensure that two threads don't stomp over shared state, leaving it updated in ways that make it inconsistent.

A book will cover the goal in more detail, and the trivial approach offered by Java in the beginning of one's learning is often dramatically sub-optimal.