Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Concurrent Patterns and Best Practices

You're reading from   Concurrent Patterns and Best Practices Build scalable apps in Java with multithreading, synchronization and functional programming patterns

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781788627900
Length 264 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Atul S. Khot Atul S. Khot
Author Profile Icon Atul S. Khot
Atul S. Khot
Arrow right icon
View More author details
Toc

What this book covers

Chapter 1, Concurrency - An Introduction, provides an introduction to concurrent programming. As you will see, concurrency is a world in itself. You will look at Unix processes and the pipes and filters for concurrency pattern. The chapter covers an overview of concurrent programming. You probably know some of this material already.

Chapter 2, A Taste of Some Concurrency Patterns, covers some essential basic concepts. The essence of the Java Memory Model is introduced. You will also look at race conditions and problems arising out of the shared state model. You will get a taste of the first concurrency pattern—hand-over-hand locking.

Chapter 3, More Threading Patterns, covers explicitly synchronizing the mutable state and the monitor pattern. You will see how this approach is fraught with problems. We wrap up with a detailed look at the Active Object design pattern.

Chapter 4, Thread Pools, covers how threads communicate via the producer/consumer pattern. The concept of thread communication is introduced. Then, the Master/Slave design pattern is explained. The chapter wraps up with another look at the map-reduce pattern as a special case of the fork-join pattern.

Chapter 5, Increasing the Concurrency, talks about the building blocks. Things such as blocking queues, bounded queues, latches, FutureTask, semaphores, and barrier are discussed. We talk about being live and safety. Finally, we describe immutability and how immutable data structures are inherently thread safe.

Chapter 6, Functional Concurrency Patterns, introduces futures and talks about its monadic nature. We cover the transformation and monad patterns and illustrate how futures compose. We also look at promises.

Chapter 7, Actors Patterns, introduces the Actor paradigm. We recall the Active Object again and then explain the actor paradigm—especially the no explicit locks nature of things. We discuss patterns such as ask versus tell, the become pattern (and stressing immutability), pipelining, and half sync or half async. We discuss these patterns and illustrate them via example code.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime