Mastering Concurrency Programming with Java 9 - Second Edition.
Master the principles to make applications robust, scalable and responsiveAbout This Book* Implement concurrent applications using the Java 9 Concurrency API and its new components* Improve the performance of your applications and process more data at the same time, taking advantage of all of your r...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2017.
|
Edición: | 2nd ed. |
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover ; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Customer Feedback; Table of Contents; Preface; Chapter 1: The First Step
- Concurrency Design Principles; Basic concurrency concepts; Concurrency versus parallelism; Synchronization; Immutable object; Atomic operations and variables; Shared memory versus message passing; Possible problems in concurrent applications; Data race; Deadlock; Livelock; Resource starvation; Priority inversion; A methodology to design concurrent algorithms; The starting point
- a sequential version of the algorithm; Step 1
- analysis.
- Step 2
- designStep 3
- implementation; Step 4
- testing; Step 5
- tuning; Conclusion; Java Concurrency API; Basic concurrency classes; Synchronization mechanisms; Executors; The fork/join framework; Parallel streams; Concurrent data structures; Concurrency design patterns; Signaling; Rendezvous; Mutex; Multiplex; Barrier; Double-checked locking; Read-write lock; Thread pool; Thread local storage; Tips and tricks for designing concurrent algorithms; Identifying the correct independent tasks; Implementing concurrency at the highest possible level; Taking scalability into account.
- Using thread-safe APIsNever assume an execution order; Preferring local thread variables over static and shared when possible; Finding the easier parallelizable version of the algorithm; Using immutable objects when possible; Avoiding deadlocks by ordering the locks; Using atomic variables instead of synchronization; Holding locks for as short a time as possible; Taking precautions using lazy initialization; Avoiding the use of blocking operations inside a critical section; Summary; Chapter 2: Working with Basic Elements
- Threads and Runnables; Threads in Java.
- Threads in Java
- characteristics and statesThe Thread class and the Runnable interface; First example: matrix multiplication; Common classes; Serial version; Parallel versions; First concurrent version
- a thread per element; Second concurrent version
- a thread per row; Third concurrent version
- the number of threads is determined by the processors; Comparing the solutions; Second example
- file search; Common classes; Serial version; Concurrent version; Comparing the solutions; Summary; Chapter 3: Managing Lots of Threads
- Executors; An introduction to executors.
- Basic characteristics of executorsBasic components of the Executor framework; First example
- the k-nearest neighbors algorithm; k-nearest neighbors
- serial version; K-nearest neighbors
- a fine-grained concurrent version; k-nearest neighbors
- a coarse-grained concurrent version; Comparing the solutions; Second example
- concurrency in a client/server environment; Client/server
- serial version; The DAO part; The command part; The server part; Client/version
- parallel version; The server part; The command part; Extra components of the concurrent server; The status command; The cache system.