Live data from Hacker News

Java Concurrency – Understanding the Basics of Threads

turkogluc.com

1–10 of 86 posts

Re: Java Concurrency – Understanding the Basics of Threads

#2
Years ago, I tried learning how to use threads by following tutorials similar to this one, where you are taught how to implement threads from {python, java, c++}. However, it wasn't until I studied operating systems (when I returned to graduate school for computer science) was I able to wrap my mind around threads — from a language agnostic view point, how and what lightweight processes are, how to implement locks and synchronization barriers — and how they help facilitate concurrency.

Re: Java Concurrency – Understanding the Basics of Threads

#3

Years ago, I tried learning how to use threads by following tutorials similar to this one, where you are taught how to implement threads from {python, java, c++}. However, it wasn't until I studied operating systems (when I returned to graduate school for computer science) was I able to wrap my mind around threads — from a language agnostic view point, how and what lightweight processes are, how to implement locks an…

What books are used in your program?

Re: Java Concurrency – Understanding the Basics of Threads

#4
The problem is not the threads, it is the mutations of variables which boost the complexity of the code. So a tutorial on creation of theads actually an invitation to hell. Nothing is cool about it. Cool thing is achieving concurrency without threads/race conditions/shared memory

Re: Java Concurrency – Understanding the Basics of Threads

#5
post #4

The problem is not the threads, it is the mutations of variables which boost the complexity of the code. So a tutorial on creation of theads actually an invitation to hell. Nothing is cool about it. Cool thing is achieving concurrency without threads/race conditions/shared memory

Do you use other paradigm / languages ? (clojure comes to mind, but maybe others)

Re: Java Concurrency – Understanding the Basics of Threads

#6
post #4

The problem is not the threads, it is the mutations of variables which boost the complexity of the code. So a tutorial on creation of theads actually an invitation to hell. Nothing is cool about it. Cool thing is achieving concurrency without threads/race conditions/shared memory

The concepts of threads and concurrent data access is simple enough for any decent programmer to comprehend. There is no hell here. Sure there are some complex cases but complex cases will arise in many situations when programming things.

And achieving concurrency without shared memory is impossible in general case. Sure it is possible to isolate such access to a separate layer and make it transparent for the rest of the program but someone still has to program such layer.

Re: Java Concurrency – Understanding the Basics of Threads

#7

Years ago, I tried learning how to use threads by following tutorials similar to this one, where you are taught how to implement threads from {python, java, c++}. However, it wasn't until I studied operating systems (when I returned to graduate school for computer science) was I able to wrap my mind around threads — from a language agnostic view point, how and what lightweight processes are, how to implement locks an…

What books are used in your program?

Idk about GP, but one book I highly recommend is Java Concurrency in Practice - https://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz...

It's old, but the material holds up well since it covers a lot of fundamentals

Re: Java Concurrency – Understanding the Basics of Threads

#9

Earlier quoted context omitted.

What books are used in your program?

Idk about GP, but one book I highly recommend is Java Concurrency in Practice - https://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz... It's old, but the material holds up well since it covers a lot of fundamentals

I also recommend it, a little bit old because it doesn't cover new features but the fundamentals are strong, Brian Goetz really did a great job.

Re: Java Concurrency – Understanding the Basics of Threads

#10
post #4

The problem is not the threads, it is the mutations of variables which boost the complexity of the code. So a tutorial on creation of theads actually an invitation to hell. Nothing is cool about it. Cool thing is achieving concurrency without threads/race conditions/shared memory

Do you use other paradigm / languages ? (clojure comes to mind, but maybe others)

For Java at least, the Java Concurrency API is preferred.
Post reply on HN