SlideShare a Scribd company logo
1 of 69
Download to read offline
@HendrikEbbers
Karakun DevHub_
dev.karakun.com
@HendrikEbbers
JavaAPIsThe missing manual
Karakun DevHub_
@HendrikEbbersdev.karakun.com
About me
• Karakun Co-Founder
• Lead of JUG Dortmund
• JSR EG member
• JavaOne Rockstar, Java Champion
• JavaLand Programm Chair
Karakun DevHub_
@HendrikEbbersdev.karakun.com
About me
@HendrikEbbers
Executors
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• Whenever code should be executed in parallel it gets
much harder…





Let's write a simple http server in Java
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
public class HttpServer {
public static void main(String… args) {
while(true) {
HttpRequest request = getNextRequest();
request.sendResponse("Hello");
}
}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
public class HttpServer {
public static void main(String… args) {
while(true) {
HttpRequest request = getNextRequest();
request.sendResponse("Hello");
}
}
}
returns the nextincoming request
sends response to client content of the response
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Headline
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• Let's test this with several users
• We can simulate this in Java



• What will happen?
URL url = new URL("http://localhost:8080/hello");

System.out.println(IOUtils.toString(url.openStream()));
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Headline
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• We can't use a single threaded approach here
• The handling must work in parallel.
• Let's have a look on a solution that is based on the
Thread class
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
public static void main(String… args) {
while(true) {
final HttpRequest request = getNextRequest();
Runnable r = () -> {
request.sendResponse("Hello");
}
new Thread(r).start();
}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Headline
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Service Provider Interface
• Only the "Application" module knows all
implementations since it's the only module that
depends on all other modules
That was easy, bro!
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• The server is working much better
• But we lost control:
• How many threads are running?
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
But the biggest question is:
How many threads
can we run in Java?
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• Using the old school Thread class seams to be a
bad idea
• Let's try to use some modern Java concurrency
classes
the java.util.concurrent package
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• To execute tasks in a background thread Java
provides the Executor interface
• Instances can be created by using the factory
methods of the Executors class
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
Executor myExecutor = Executors.newSingleThreadExecutor();
Runnable r = () -> doSomeAction();
myExecutor.execute(r);
Creates an executer
Runnable will be
executed in a thread.
method call do not block
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
Executor myExecutor = Executors.newSingleThreadExecutor();
Executor myExecutor = Executors.newFixedThreadPool(5);
Wraps one thread
Wraps 5 threads
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• Executor instances can easily be reused.
• No need to create a new one for each call.
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• Different behavior based on the given Executor
for(int i = 0; i < 100; i++) {
final Runnable r = () -> {
sleep(2_000);
print("Moin");
}
executor.execute(r);
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
Let me introduce you the
CELEBRITY
EXECUTOR
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• No specific thread count defined
• Threads will be created and destroyed based on the
work load
• Threads will be reused
Executor myExecutor = Executors.newCachedThreadPool();
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
public static void main(String… args) {
final Executor executor = Executors.newCachedThreadPool();
while(true) {
final HttpRequest request = getNextRequest();
final Runnable r = () -> {
request.sendResponse("Hello");
}
executor.execute(r);
}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• We said that we do not want to use the Thread
class anymore.
• All types are based on threads…
• And we can configure them…
• So let's use Thread again
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
• A custom thread factory can be used to create an
executor
• Thread factory can configure the internal threads
ThreadFactory tf = . . .
Executor myExecutor = Executors.newCachedThreadPool(tf);
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
public class MyThreadFactory implements ThreadFactory {



final AtomicLong counter = new AtomicLong(0);



@Override

public Thread newThread(Runnable r) {

final Thread thread = new Thread();

thread.setName("My private thread " + counter.incrementAndGet());

thread.setUncaughtExceptionHandler((t, e) -> {
System.out.println("BOOOOOOM!");
});

return thread;

}

}

Karakun DevHub_
@HendrikEbbersdev.karakun.com
Executors
But wait!
the factory returns
ExecutorService
and not
Executor
instances
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Headline
• ExecutorService provides a lot of
new functionality.
• We will handle this in a separate
chapter
@HendrikEbbers
Sync
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
• Let's start this chapter with a simple class
• Only a wrapper for a list
• What could go wrong…
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
public class Holder {
private final List<String> data = new ArrayList<>();
public void add(String v) {this.data.add(v);}
public void remove(String v) {this.data.remove(v);}
public void forEach(Consumer c) { data.forEach(c);}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
add("A");
add("B");
add("C");
add("D");
add("E");
add("F");
add("G");
add("H");
remove("1");
remove("2");
remove("3");
remove("4");
remove("5");
remove("6");
remove("7");
remove("8");
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
User A User B User C
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
add("A");
add("B");
add("C");
add("D");
add("E");
add("F");
add("G");
add("H");
remove("1");
remove("2");
remove("3");
remove("4");
remove("5");
remove("6");
remove("7");
remove("8");
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
forEach(. . .);
User A User B User C
Thread Thread Thread
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
ConcurrentModificationException
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
ConcurrentModificationException
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Synchronization
• Java provides a keyword that defines synchronized
access for such use cases
Do you know The Keyword?
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
public synchronized void add(String v) {. . .}
public synchronized void remove(String v) {. . .}
public synchronized void forEach(Consumer c) {. . .}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
add("A");
add("B");
add("C");
remove("1");
remove("2");
remove("3");
forEach(. . .);
forEach(. . .);
wait
wait
wait
wait
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
• The synchronized keyword provides thread
synchronization
• Internally Java provides a monitor lock
• Each monitor is bound to an object
• Java provides several ways how the
synchronized keyword can be used
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
public synchronized void add(String v) {. . .}
}
Lock is based on this (the
object instance)
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
final Holder a = new Holder();
final Holder b = new Holder();
doSomeParallelStuff(a, b);
No synchronization between
instance a and B
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
public static synchronized void myMethod() {. . .}
}
Lock is based on the
Holder class
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
• The synchronized keyword provides reentrant
functionality
• A lock is always bound to the current thread
• A thread can acquire the same lock several times
• Helps to avoid deadlocks
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
public synchronized void myMethod() {
myOtherMethod();
}
public synchronized void myOtherMethod() {
//TODO: add code
}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
• Using synchronized can create some problems
• Think about using synchronized in a base class and
derived classes
• Ends in implicit synchronization dependencies
• Can end in deadlocks
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
private final List<String> l = new ArrayList();
public synchronized void add(String v) {l.add(v);}
public synchronized void remove(String v) {l.remove(v);}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class MyHolder extends Holder {
private final List<Integer> l = new ArrayList();
public synchronized void addInt(int v) {l.add(v);}
}
It is not possible to call
the 2 add methods in
parallel
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class MyHolder extends Holder {
private final List<Integer> l = new ArrayList();
public synchronized void run() {
while(true) {
sleep(1000);
printTime();
}
}
}
Once this is called all
synchronised methods form
Holder class are useless…
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
• Try to use synchronized by specifying a private
monitor object
• To do so synchronized can be used as a block
statement
• Derived classes can not access the monitor object
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
public class Holder {
private final Object monitor = new Object();
public void myMethod() {
synchronized(monitor) {
//TODO: add code
}
}
}
Internal Code of the block
is synchronized.
Lock is based on monitor
object / instance
Karakun DevHub_
@HendrikEbbersdev.karakun.com
synchronized
• Since synchronized is a Java keyword it is
compiled in specified byte code instructions
• Instructions called MonitorEnter and
MonitorExit
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• Since Java 1.5 we can use a Java API for
synchronization
• Against the synchronized keyword we have all the
benefits of an API
• See java.util.concurrent.locks.Lock
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
public class Holder {
private final List<String> listA;
private final Lock listLockA;
private final List<String> listB;
private final Lock listLockB;
}
Just define a lock instance
for each Monitor that
should be synchronized
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• Use ReentrantLock as concrete type
private final Lock listLockA = new ReentrantLock();
Same behavior as synchronized
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• A Lock controls access to a shared resource by
multiple threads
• The most important methods of a Lock are lock()
and unlock()
• This method defines exclusive access to a resource
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• By calling lock() the resource will be locked by the
current thread
• By calling unlock() the current thread can finish
the exclusive locking of the resource
• Calling lock() will block the current thread until no
other thread has an exclusive lock
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
public void addToA(final String v) {
listLockA.lock();
getListA().add(v);
listLockA.unlock();
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Service Provider Interface
• Only the "Application" module knows all
implementations since it's the only module that
depends on all other modules
That was easy, bro!
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
public void addToA(String v) {
listLockA.lock();
getListA().add(v);
listLockA.unlock();
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
public void addToA(String v) {
listLockA.lock();
getListA().add(v);
listLockA.unlock();
}
Exception
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• NEVER, NEVER, NEVER USE LOCK WITHOUT
TRY-FINAL
lock.lock();
try {
//access resource
} finally {
lock.unlock();
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
public void addToA(String v) {
listLockA.lock();
try {
getListA().add(v);
} finally {
listLockA.unlock();
}
}
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Lock
• Even more complexe use cases are supported by
the Lock API.
• Use tryLock() to not block threads.
• Create a Condition for monitor functionality.
Will be handled in a
separate topic
Karakun DevHub_
@HendrikEbbersdev.karakun.com
Other solutions
• By the way the complete problem could be handled
in a different way:

• Java provides some special collection types to get
rid of ConcurrentModificationException:
Will be handled in a
separate topic
private final List<String> listA = new ArrayList<>();
List<String> listA = new CopyOneWriteArrayList<>();
@HendrikEbbers
• Check our website for developers

• Subscribe to our newsletter

• Join us
dev.karakun.com | @HendrikEbbers
Karakun DevHub_
dev.karakun.com
https://dev.karakun.com
https://dev.karakun.com/subscribe/
https://dev.karakun.com/you-at-karakun/

More Related Content

What's hot

Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemBruno Borges
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React BasicsRich Ross
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateMartin Grebac
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014Ryan Cuprak
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Roberto Cortez
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016Ed Burns
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015Pavel Bucek
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsShekhar Gulati
 
Grails At Linked
Grails At LinkedGrails At Linked
Grails At LinkedLinkedIn
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web FrameworkDaniel Woods
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performancegvenzl
 
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging PlatformsGame of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging PlatformsVMware Tanzu
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...jeckels
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
 
How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17Johan Janssen
 
Grails patterns and practices
Grails patterns and practicesGrails patterns and practices
Grails patterns and practicespaulbowler
 

What's hot (20)

Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and update
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
Grails At Linked
Grails At LinkedGrails At Linked
Grails At Linked
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web Framework
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performance
 
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging PlatformsGame of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17
 
Grails patterns and practices
Grails patterns and practicesGrails patterns and practices
Grails patterns and practices
 

Similar to Java APIs- The missing manual (concurrency)

Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksWO Community
 
Concurrent Programming in Java
Concurrent Programming in JavaConcurrent Programming in Java
Concurrent Programming in JavaRuben Inoto Soto
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsCarol McDonald
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/MultitaskingSasha Kravchuk
 
What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrencykshanth2101
 
Background Jobs with Resque
Background Jobs with ResqueBackground Jobs with Resque
Background Jobs with Resquehomanj
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes BackBurke Libbey
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot NetNeeraj Kaushik
 
Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Orkhan Gasimov
 
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoWebpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoRyan Weaver
 
Scala Future & Promises
Scala Future & PromisesScala Future & Promises
Scala Future & PromisesKnoldus Inc.
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav DukhinFwdays
 
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Sachintha Gunasena
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
Testcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentationTestcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentationRichard North
 

Similar to Java APIs- The missing manual (concurrency) (20)

Introduction+To+Java+Concurrency
Introduction+To+Java+ConcurrencyIntroduction+To+Java+Concurrency
Introduction+To+Java+Concurrency
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background Tasks
 
Concurrent Programming in Java
Concurrent Programming in JavaConcurrent Programming in Java
Concurrent Programming in Java
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and Trends
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/Multitasking
 
What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrency
 
Background Jobs with Resque
Background Jobs with ResqueBackground Jobs with Resque
Background Jobs with Resque
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
 
Play Framework
Play FrameworkPlay Framework
Play Framework
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot Net
 
Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]
 
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoWebpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
 
Scala Future & Promises
Scala Future & PromisesScala Future & Promises
Scala Future & Promises
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Testcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentationTestcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentation
 

More from Hendrik Ebbers

Beauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptBeauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptHendrik Ebbers
 
Multidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXMultidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXHendrik Ebbers
 
Java ap is you should know
Java ap is you should knowJava ap is you should know
Java ap is you should knowHendrik Ebbers
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016Hendrik Ebbers
 
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxBUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxHendrik Ebbers
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Hendrik Ebbers
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)Hendrik Ebbers
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)Hendrik Ebbers
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)Hendrik Ebbers
 
Feature driven development
Feature driven developmentFeature driven development
Feature driven developmentHendrik Ebbers
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIHendrik Ebbers
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundHendrik Ebbers
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetHendrik Ebbers
 

More from Hendrik Ebbers (20)

Beauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptBeauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScript
 
Multidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXMultidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UX
 
Java ap is you should know
Java ap is you should knowJava ap is you should know
Java ap is you should know
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
 
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxBUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
 
Feature driven development
Feature driven developmentFeature driven development
Feature driven development
 
Extreme Gui Makeover
Extreme Gui MakeoverExtreme Gui Makeover
Extreme Gui Makeover
 
JavaFX Enterprise
JavaFX EnterpriseJavaFX Enterprise
JavaFX Enterprise
 
Bonjour for Java
Bonjour for JavaBonjour for Java
Bonjour for Java
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and Puppet
 
Jgrid
JgridJgrid
Jgrid
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Java APIs- The missing manual (concurrency)