Mastering concurrency programming with Java 8 : master the principles and techniques of multithreaded programming with the Java 8 concurrency API / Javier Fern�andez Gonz�alez.
Material type: TextSeries: Community experience distilledPublisher: Birmingham, UK : Packt Publishing, 2016Description: 1 online resource (1 volume) : illustrationsContent type:- text
- computer
- online resource
- 9781785885464
- 1785885464
- Java (Computer program language)
- Computer multitasking
- Electronic data processing -- Distributed processing
- Parallel processing (Electronic computers)
- Application software -- Development
- COMPUTERS / Programming Languages / Java
- Application software -- Development
- Computer multitasking
- Electronic data processing -- Distributed processing
- Java (Computer program language)
- Parallel processing (Electronic computers)
- 005.133 23
- QA76.73.J38
Online resource; title from cover page (Safari, viewed March 24, 2016).
Includes index.
Cover ; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; 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 -- design
Step 3 -- implementationStep 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; The Java memory model; Tips and tricks to design concurrent algorithms; Identify the correct independent tasks; Implement concurrency at the highest possible level; Take scalability into account
Use thread-safe APIsNever assume an execution order; Prefer local thread variables over static and shared when possible; Find the more easily 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: Managing Lots of Threads -- Executors ; An introduction to executors; Basic characteristics of executors
Basic components of the executor frameworkFirst 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; The second example -- concurrency in a client/server environment; Client/server -- serial version; The DAO part; The command part; The server part; Client/server -- parallel version; The server part; The command part; Extra components of the concurrent server; Comparing the two solutions; Other methods of interest; Summary
Chapter 3: Getting the Maximum from Executors Advanced characteristics of executors; Cancellation of tasks; Scheduling the execution of tasks; Overriding the executor methods; Changing some initialization parameters; The first example -- an advanced server application; The ServerExecutor class; The statistics object; The rejected task controller; The executor tasks; The executor; The command classes; The ConcurrentCommand class; Concrete commands; The server part; The ConcurrentServer class; The RequestTask class; The client part; The second example -- executing periodic tasks
eBooks on EBSCOhost EBSCO eBook Subscription Academic Collection - Worldwide