Java Reference
In-Depth Information
23
Concurrency
The most general definition of
beauty…Multeity in Unity.
—Samuel Taylor Coleridge
Do not block the way of inquiry.
—Charles Sanders Peirce
Learn to labor and to wait.
—Henry Wadsworth Longfellow
Objectives
In this chapter you'll:
Understand concurrency,
parallelism and
multithreading.
Learn the thread life cycle.
Use ExecutorService to
launch concurrent threads
that execute Runnable s.
Use synchronized
methods to coordinate access
to shared mutable data.
Understand producer/
consumer relationships.
Use SwingWorker to
update Swing GUIs in a
thread-safe manner.
Compare the performance of
Arrays methods sort and
parallelSort on a multi-
core system.
Use parallel streams for better
performance on multi-core
systems.
Use CompletableFuture s
to execute long calculations
asynchronously and get the
results in the future.
 
 
Search WWH ::




Custom Search