Angelika Langer - Training & Consulting
HOME | COURSES | TALKS | ARTICLES | GENERICS | LAMBDAS | IOSTREAMS | ABOUT | NEWSLETTER | CONTACT | Twitter | Lanyrd | Linkedin
HOME 


  UPCOMING
  PREVIOUS
  MATERIALS
 
GENERICS 
LAMBDAS 
IOSTREAMS 
ABOUT 
NEWSLETTER 
CONTACT 
New Concurrency Utilities in Java 8

New Concurrency Utilities in Java 8  
ABSTRACT

There are a couple of new concurrency utilities in Java 8.  The most relevant one is CompletableFuture.  The regular Future is used for retrieval of a result that is produced by a task (typically a task that is executed in a thread pool).  For this purpose the regular Future supports waiting for the result and retrieving it once it has been produced. After retrieval the result is processed synchronously.  The new CompletableFuture, in contrast, supports asynchronous result processing: we need not wait until the result of a task has been produced, instead we can upfront specify an action (the result processing) that will later be executed automatically when the result appears. 

In addition, Java 8 comes with a couple of minor extensions related to concurrency: StampedLock (a ReadWriteLock with optimistic Read), LongAdder / LongAccumulator (as an alternative to AtomicLong), new operations in ConcurrentHashMap (e.g.. computeIfAbsent, forEach, reduce, search), the Common Pool (a singleton ForkJoinPool) and the @Contended annotation (to prevent False Sharing). 

PREREQUISITES

 
 
Level: introductory - intermediate
Duration: 60 min presentation
Audience: Java developers with an interest in Java 8
Presented at: JAX 2014 , Mainz, Germany, May 12-16,  2014

 
 

Related information:
Seminars
 
Concurrent Java
4-day seminar (open enrollment / on-site)
Java 8 - Overview of Lambdas/Streams, New Concurrency Utilities, and Date/Time
3-day seminar (open enrollment / on-site)
 
Papers
 
online FAQ Concurrent Programming in Java
Articles from the "Effective Java" column

 
  © Copyright 1995-2014 by Angelika Langer.  All Rights Reserved.    URL: < http://www.AngelikaLanger.com/Conferences/Abstracts/Java8-ConcurrencyUtilities.htm  last update: 19 Jun 2014