My Account Log in

3 options

Mastering concurrency programming with java 9 : perfect the art of faster and more effective programming with parallel and reactive streams / Javier Fernandez Gonzalez.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Fernández González, Javier, author.
Language:
English
Subjects (All):
Java (Computer program language).
Physical Description:
1 online resource (1 volume) : illustrations
Edition:
Second edition.
Place of Publication:
Birmingham, England ; Mumbai, [India] : Packt, 2017.
System Details:
text file
Biography/History:
Gonzalez Javier Fernandez: Javier Fernandez is a software architect with almost 15 years experience with Java technologies. He has worked as a teacher, researcher, programmer, analyst, writer and now as an architect in all types of projects related to Java, especially J2EE. As a teacher, has taught over 1000 hours of training in basic Java, J2EE and Struts framework. As a researcher, has worked in the field of information retrieval developing applications for processing large amounts of data in Java and has participated as co-author on several journal articles and conference presentations. In recent years, has worked on developing J2EE web applications for various clients from different sectors (public administration, insurance, healthcare, transportation, .. .). Currently he works as a software architect at Capgemini developing and maintaining applications for an insurance company. He is the author of the book Java 7 Concurrency Cookbook.
Summary:
Master the principles to make applications robust, scalable and responsive About 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 resources Construct real-world examples related to machine learning, data mining, natural language processing, and more Who This Book Is For This book is for competent Java developers who have basic understanding of concurrency, but knowledge of effective implementation of concurrent programs or usage of streams for making processes more efficient is not required What You Will Learn Master the principles that every concurrent application must follow See how to parallelize a sequential algorithm to obtain better performance without data inconsistencies and deadlocks Get the most from the Java Concurrency API components Separate the thread management from the rest of the application with the Executor component Execute phased-based tasks in an efficient way with the Phaser components Solve problems using a parallelized version of the divide and conquer paradigm with the Fork / Join framework Find out how to use parallel Streams and Reactive Streams Implement the ?map and reduce? and ?map and collect? programming models Control the concurrent data structures and synchronization mechanisms provided by the Java Concurrency API Implement efficient solutions for some actual problems such as data mining, machine learning, and more In Detail Concurrency programming allows several large tasks to be divided into smaller sub-tasks, which are further processed as individual tasks that run in parallel. Java 9 includes a comprehensive API with lots of ready-to-use components for easily implementing powerful concurrency applications, but with high flexibility so you can adapt these components to your needs. The book starts with a full description of the design principles of concurrent applications and explains how to parallelize a sequential algorithm. You will then be introduced to Threads and Runnables, which are an integral part of Java 9's concurrency API. You will see how to use all the components of the Java concurrency API, from the basics to the most advanced techniques, and will implement them in powerful real-world concurrency applications. The book ends with a detailed description of the tools and techniques you can use to test a concurrent Java application...
Contents:
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 - design
Step 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 APIs
Never 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 states
The 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
Concurrent version
Chapter 3: Managing Lots of Threads - Executors
An introduction to executors
Basic characteristics of executors
Basic 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
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
Extra components of the concurrent server
The status command
The cache system
The log system
Comparing the two solutions
Other methods of interest
Chapter 4: Getting the Most from Executors
Advanced characteristics of executors
Cancellation of tasks
Scheduling the execution of tasks
Overriding the executor methods
Changing some initialization parameters
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
The concrete commands
The server part.
The ConcurrentServer class
The RequestTask class
The client part
Second example - executing periodic tasks
The common parts
The basic reader
The advanced reader
Additional information about executors
Chapter 5: Getting Data from Tasks - The Callable and Future Interfaces
Introducing the Callable and Future interfaces
The Callable interface
The Future interface
First example - a best-matching algorithm for words
The common classes
A best-matching algorithm - the serial version
The BestMatchingSerialCalculation class
The BestMachingSerialMain class
A best-matching algorithm - the first concurrent version
The BestMatchingBasicTask class
The BestMatchingBasicConcurrentCalculation class
A best-matching algorithm - the second concurrent version
Word exists algorithm - a serial version
The ExistSerialCalculation class
The ExistSerialMain class
Word exists algorithm - the concurrent version
The ExistBasicTasks class
The ExistBasicConcurrentCalculation class
The ExistBasicConcurrentMain class
Best-matching algorithms
Exist algorithms
The second example - creating an inverted index for a collection of documents
The Document class
The DocumentParser class
The serial version
The first concurrent version - a task per document
The IndexingTask class
The InvertedIndexTask class
The ConcurrentIndexing class
The second concurrent version - multiple documents per task
The MultipleIndexingTask class
The MultipleInvertedIndexTask class
The MultipleConcurrentIndexing class
Chapter 6: Running Tasks Divided into Phases - The Phaser Class
An introduction to the Phaser class
Registration and deregistration of participants.
Synchronizing phase change
Other functionalities
First example - a keyword extraction algorithm
The Word class
The Keyword class
The concurrent version
The KeywordExtractionTask class
The ConcurrentKeywordExtraction class
The second example - a genetic algorithm
The Individual class
The GeneticOperators class
The SerialGeneticAlgorithm class
The SerialMain class
The SharedData class
The GeneticPhaser class
The ConcurrentGeneticTask class
The ConcurrentGeneticAlgorithm class
The ConcurrentMain class
Lau15 dataset
Kn57 dataset
Conclusions
Chapter 7: Optimizing Divide and Conquer Solutions - The Fork/Join Framework
An introduction to the fork/join framework
Basic characteristics of the fork/join framework
Limitations of the fork/join framework
Components of the fork/join framework
The first example - the k-means clustering algorithm
The VocabularyLoader class
The word, document, and DocumentLoader classes
The DistanceMeasurer class
The DocumentCluster class
The SerialKMeans class
Two tasks for the fork/join framework - AssignmentTask and UpdateTask
The ConcurrentKMeans class
The second example - a data filtering algorithm
Common features
The SerialSearch class
The TaskManager class
The IndividualTask class
The ListTask class
The ConcurrentSearch class
The ConcurrentMain class.
Comparing the two versions
The third example - the merge sort algorithm
Shared classes
The SerialMergeSort class
The SerialMetaData class
The MergeSortTask class
The ConcurrentMergeSort class
The ConcurrentMetaData class
Comparing the two versions
Other methods of the fork/join framework
Chapter 8: Processing Massive Datasets with Parallel Streams - The Map and Reduce Model
An introduction to streams
Basic characteristics of streams
Sections of a stream
Sources of a stream
Intermediate operations
Terminal operations
MapReduce versus MapCollect
The first example - a numerical summarization application
The ConcurrentDataLoader class
The ConcurrentStatistics class
Customers from the United Kingdom
Quantity from the United Kingdom
Countries for product
Quantity for product
Multiple data filter
Highest invoice amounts
Products with a unit price between 1 and 10
The second example - an information retrieval search tool
An introduction to the reduction operation
The first approach - full document query
The basicMapper() method
The Token class
The QueryResult class
The second approach - reduced document query
The limitedMapper() method
The third approach - generating an HTML file with the results
The ContentMapper class
The fourth approach - preloading the inverted index
The ConcurrentFileLoader class
The fifth approach - using our own executor
Getting data from the inverted index - the ConcurrentData class
Getting the number of words in a file
Getting the average tfxidf value in a file
Getting the maximum and minimum tfxidf values in the index.
The ConcurrentMain class.
Notes:
Includes index.
Description based on online resource; title from PDF title page (ebrary, viewed August 14, 2017).
OCLC:
1002220427

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account