Live data from Hacker News

Things You Didn’t Know About Synchronization in Java and Scala

takipiblog.com

21–24 of 24 posts

Re: Things You Didn’t Know About Synchronization in Java and Scala

#21

Earlier quoted context omitted.

Just remember under the covers Akka is still using synchronization.

You mean internally? The paradigm they use is immutable-message passing and asynchronous/concurrent processing.

Yes internally. Somewhere deep in the bowels of the akka code, they are communicating state between threads (last I checked they were using a java concurrent queue by default).

At a bare minimum the changes to the location of the head/tail of a queue will need to be visible to multiple threads requiring volatile variables.

The java concurrent queues don't actually use synchronization blocks, they use native CAS operations but thinking that akka removes shared thread state entirely is dangerous.

Re: Things You Didn’t Know About Synchronization in Java and Scala

#23
post #2

If this is interesting to you then I'd highly recommend Java Concurrency in Practice [1]. It goes through the then-new java.util.concurrent package, but more importantly, does a really good job of making all of the theoretical concepts straightforward to grasp 1 - http://www.amazon.com/gp/aw/d/0321349601

I've been searching for a book like this for .NET and the CLR to no avail. Can anyone recommend one? Or is this book applicable beyond Java?

Concurrent Programming on Windows by Joe Duffy http://www.amazon.com/exec/obidos/ASIN/032143482X/bluebyteso...

Re: Things You Didn’t Know About Synchronization in Java and Scala

#24

Earlier quoted context omitted.

I've been searching for a book like this for .NET and the CLR to no avail. Can anyone recommend one? Or is this book applicable beyond Java?

Concurrent Programming on Windows by Joe Duffy http://www.amazon.com/exec/obidos/ASIN/032143482X/bluebyteso...

Thanks. I will take a look.
Post reply on HN