News for hackers. Stuff that matters.
Re:JDK 8 Release Notes by hugofirth on Tuesday March 18, 2014 @04:23PM (#7424742)
Is there any chance you could briefly enumerate some of the things that make the JVM's approach to concurrency so strong? I'd be interested.
Re:JDK 8 Release Notes by pron on Tuesday March 18, 2014 @05:46PM (#7425248)
It's not the approach, but the capabilities:

1. State-of-the-art garbage collectors, which enable good implementations of lock-free data structures.

2. Excellent implementations of lock-free data structures (like ConcurrentLinkedQueue and ConcurrentSkipListMap) and other concurrent data structures (like ConcurrentHashMap).

3. A state-of-the-art work-stealing scheduler (ForkJoinPool), excellent for both parallelism (as used by Java 8's streams) and concurrency.

4. A cross-platform memory model specifying memory visibility across threads.

5. Access to CPU concurrency primitives like CAS and memory fences.

These building blocks are a great foundation for any concurrent application.

Re:JDK 8 Release Notes by hugofirth on Tuesday March 18, 2014 @06:40PM (#7425552)
Thanks - I use Java all the time - but sometimes I find knowing which data structures to turn to in a given situation tough.
Re:JDK 8 Release Notes by azinman2 on Tuesday March 18, 2014 @11:29PM (#7426660)
That's true for any language, and any platform. The language can't save you from having to, at some point, understand how to properly engineer software.
Re:JDK 8 Release Notes by DaveLond on Wednesday March 19, 2014 @05:40AM (#7427513)
Grab a copy of "java concurrency in practice", it's my go-to book for when I've got a tricky concurrency problem to solve.
Re:JDK 8 Release Notes by smikhanov on Tuesday March 18, 2014 @06:15PM (#7425430)
Could you please elaborate on #5? What you mean there is the fact that AtomicInteger implementation is actually using this primitives on your target platform, correct?
Re:JDK 8 Release Notes by pron on Tuesday March 18, 2014 @06:19PM (#7425453)
It's more than that. AtomicInteger's implementation uses JVM intrinsics which are calls to methods in the sun.misc.Unsafe class, that, when JITted, are replaced by a platform specific machine instruction (where available), such as CAS or a memory fence.