addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [ljc] Concurrency, multi-threaded programming: under the hood

From: Neil B.
Sent on: Monday, March 18, 2013, 10:51 AM
For a really deep understanding of concurrency in general -- from the hardware implementation up to algorithms and applications -- I strongly recommend "The Art of Multiprocessor Programming" by Maurice Herlihy and Nir Shavit. The example code is (mostly) in Java.

On Mon, Mar 18, 2013 at 10:41 AM, Stephen Henderson <[address removed]> wrote:
I'd add Venkat Subramaniam's "programming concurrency on the jvm" to that list too: http://pragprog.com/book/vspcon/programming-concurrency-on-the-jvm

It covers the more recent concurrency structures available in Scala, Clojure and Akka, (Actors, STM, etc.) as well as tips on designing for immutability. He's also very good at giving examples of how to use these libraries in plain java apps if you're not in the position to switch languages (it's not always pretty, but it's doable).

It does assume that you already have a good understanding of the standard java concurrency libraries though, so I'd still go with conncurrency in practice as a first step.


Stepehn



On 18 March[masked]:07, Martijn Verburg <[address removed]> wrote:
Hi Tomas,

If you need to learn this topic for Java then Java Concurrency in Practice + a little of Effective Java is the way to go.  With Java 8 coming in soon and some new concurrency features in Java 7 there's room for a new title on concurrency to come out...


Cheers,
Martijn


On 17 March[masked]:33, Tomas Rimšelis <[address removed]> wrote:
Hello all,
Currently I am looking for a material for an in-depth study of concurrency in Java and would like to know your opinion if mentioned books are still up to date? I know that some things, especially design principles, don't age, but still – Concurrent Programming in Java was released in 1999, Java Concurrency in Practice in 2006, Effective Java re-released in 2008. And maybe there are any other good books worth recommending?

Cheers!


On Sun, Mar 17, 2013 at 12:53 PM, Martijn Verburg <[address removed]> wrote:
+1 - Ben and I would also add that Java's Thread is like using assembly language for doing concurrency work on the JVM - try not to use it directly :-).

Heck, if you're really serious about using concurrent, thread-safe libraries and constructs you may actually want to look at languages on the JVM that *aren't* Java (which has mutability by default). The java.util.concurrent package combined with Brian's teachings is adequate (not even Brian and Doug Lea state they get it right all of the time), but no longer state of the art (Java 8 will bring some parity back). Looking at language/framework combinations such as Scala/Akka, Groovy/GPARs & Clojure will do you no harm, they tend to give you more inherit safety out of the box.

Also, several good points have been made on this thread about understanding your JVM, hardware and O/S - as mentioned, throwing 100 threads at a dual core CPU isn't going to help. I'll be talking about this again at Devoxx UK ("Java and the Machine"), and there are several other concurrency talks on as well, I'd recommend getting along to them.



Cheers,
Martijn


On 17 March[masked]:58, Jack Shirazi <[address removed]> wrote:
Concurrency is hard. When I interview people, I am one of those who ask about concurrency. Usually I'm asking about how you diagnose concurrency issues, rather than how you code anything - because you can give all sorts of answers about concurrency coding whatever your level of experience, whereas you have to have a certain minimum level of understanding to explain how to diagnose issues.

The primary way to code concurrently and minimize concurrency bugs is to avoid explcitly writing concurrency code. This is my understanding from my concurrency guru - Brian Goetz. Basically, Brian's advice is that if you find yourself starting to write explicit concurrency handling, stop and look for a library class that does what you want, because concurrency bugs are subtle, non-obvious, and often difficult to reproduce, and the library class is likely to have had to handle most of them and been debugged by a community. The other things he's suggested, immutable objects, non-shared objects, etc, those are all workarounds when you can't find a library to do what you want.

The whole lambda addition in Java 8 is exactly along this line - if you use lambdas the code is concurrently executable by the libraries without you having to explicitly do any explicit concurrent handling (which is one of the reasons Brian is spearheading the project, it's close to his heart). Of course you have to be careful to avoid inadvertent concurrent data sharing or face the consequent race conditions, but you can't have everything.

Advice to students would be to read whatever Brian has written that's out there.
Cheers
-Jack


On 16/03/[masked]:36, Barry Cranford wrote:
Hi all,

We are often tasked to find Java developers with an understanding of low level core Java. Not necessarily specialist contractors at 5-600 pday, but permanent developers, one may classify as mid-senior level (40-60k). When pushed this is often defined by developers that understand what is going on 'under the hood' e.g. not just how to use popular frameworks but those that understand the concepts and principles beneath them. Whilst some companies will be a little more easy on practical experience, they will push for an understanding. 

Many developers don't make it through interview processes with feedback coming up time and again around a lack of understanding of multi threaded programming and concurrency. I have seen a few conversations recently on the list around these areas so I'm keen to understand the thoughts of the community on this. 

A few things I'm curious about...

- If we could put on some deep dive talks what subjects would you personally most like to have covered?
- Why are some developers drawn to this deeper level and why do some people seem to grasp these concepts so easily against others? 
- If you could offer advice to students starting out in Java development today, how would you suggest learning the fundamentals of these concepts? (reading, self study, projects, talks, oss, something else)?
- Have you been through this learning process in the past and had a eureka moment? What happened for you personally.





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jack Shirazi ([address removed]) from LJC - London Java Community.
To learn more about Jack Shirazi, visit his/her member profile





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Martijn Verburg ([address removed]) from LJC - London Java Community.
To learn more about Martijn Verburg, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]



--
Regards,
Tomas Rimselis
Java dev




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Tomas Rimšelis ([address removed]) from LJC - London Java Community.
To learn more about Tomas Rimšelis, visit his/her member profile





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Martijn Verburg ([address removed]) from LJC - London Java Community.
To learn more about Martijn Verburg, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Stephen Henderson ([address removed]) from LJC - London Java Community.
To learn more about Stephen Henderson, visit his/her member profile

People in this
group are also in: