Grokking Concurrency (Final Release) 9781633439771

This easy-to-read, hands-on guide demystifies concurrency concepts like threading, asynchronous programming, and paralle

145 96 9MB

English Pages 306 Year 2023

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
inside front cover
Grokking Concurrency
Copyright
dedication
contents
front matter
preface
acknowledgments
about this book
about the author
Part 1. The octopus orchestra: Introduction to a symphony of concurrency
1 Introducing concurrency
Why is concurrency important?
Layers of concurrency
What you’ll learn from this book
Recap
2 Serial and parallel execution
Review: What is a program?
Serial execution
Sequential computations
Parallel execution
Parallel computing requirements
Parallel computing
Amdahl’s law
Gustafson’s law
Concurrency vs. parallelism
Recap
3 How computers work
Processor
Runtime system
Design of computer systems
Multiple levels of concurrent hardware
Recap
4 Building blocks of concurrency
Concurrent programming steps
Processes
Threads
Recap
5 Interprocess communication
Types of communication
Thread pool pattern
Cracking passwords, revisited
Recap
Part 2. The many tentacles of concurrency: Multitasking, decomposition, and synchronization
6 Multitasking
CPU-bound and I/O-bound applications
The need for multitasking
Multitasking from a bird’s-eye view
Multitasking environments
Recap
7 Decomposition
Dependency analysis
Task decomposition
Task decomposition: Pipeline pattern
Data decomposition
Granularity
Recap
8 Solving concurrency problems: Race conditions and synchronization
Shared resources
Race conditions
Synchronization
Recap
9 Solving concurrency problems: Deadlocks and starvation
Dining philosophers
Deadlocks
Livelocks
Starvation
Designing synchronization
A last few words
Recap
Part 3. Asynchronous octopuses: A pizza-making tale of concurrency
10 Nonblocking I/O
The distributed world
Client-server model
Pizza-ordering service
Blocking I/O
Nonblocking I/O
Recap
11 Event-based concurrency
Events
Callbacks
Event loop
I/O multiplexing
Event-driven pizza server
Reactor pattern
Synchronization in message passing
I/O models
Recap
12 Asynchronous communication
A need for asynchrony
Asynchronous procedure calls
Cooperative multitasking
Future objects
Cooperative pizza server
Asynchronous pizza joint
Conclusions on the asynchronous model
Recap
13 Writing concurrent applications
So, what is concurrency?
Foster’s methodology
Matrix multiplication
Distributed word count
Recap
Epilogue
index
inside back cover

Grokking Concurrency (Final Release)
 9781633439771

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers