text.skipToContent text.skipToNavigation
  1. Home
  2. Computer Science & IT
  3. Java Concurrency in Practice

Java Concurrency in Practice, 1st edition

  • Brian Goetz
  • Tim Peierls
  • Joshua Bloch
  • Joseph Bowbeer
  • David Holmes
  • Doug Lea

Published by Addison-Wesley Professional (May 9th 2006) - Copyright © 2006

1st edition

Chosen format
View all
Java Concurrency in Practice

ISBN-13: 9780321349606

Includes: Paperback
Free delivery
$59.99

What's included

  • Paperback

    You'll get a bound printed text.

Overview

A how-to companion to Doug Lea's "Concurrent Programming in Java", this book is the only authorative and practical guide to Java Concurrency

° Powerhouse author team with contributions from Doug Lea, Josh Bloch and David Holmes

° A practical, hands-on, example-driven guide for every working Java programmer

° Based on J2SE 5.0 which includes many new concurrency features that make concurrency development much more accesible (and necessary)

Table of contents

Listings     xii
Preface     xvii


Chapter 1: Introduction     1

1.1  A (very) brief history of concurrency       1
1.2  Benefits of threads      3
1.3  Risks of threads       5
1.4  Threads are everywhere       9

Part I: Fundamentals     13

Chapter 2: Thread Safety     15

2.1  What is thread safety?      17
2.2  Atomicity     19
2.3  Locking     23
2.4  Guarding state with locks      27
2.5  Liveness and performance       29

Chapter 3: Sharing Objects     33

3.1  Visibility      33
3.2  Publication and escape       39
3.3  Thread confinement       42
3.4  Immutability       46
3.5  Safepublication       49

Chapter 4: Composing Objects     55

4.1  Designing a thread-safe class      55
4.2  Instance confinement      58
4.3  Delegating thread safety      62
4.4  Adding functionality to existing thread-safe classes       71
4.5  Documenting synchronization policies       74

Chapter 5: Building Blocks     79

5.1  Synchronized collections       79
5.2  Concurrent collections     84
5.3  Blocking queues and the producer-consumer pattern     87
5.4  Blocking and interruptible methods     92
5.5  Synchronizers     94
5.6  Building an efficient, scalable result cache      101

Part II: Structuring Concurrent Applications     111

Chapter 6: Task Execution     113

6.1  Executing tasks in threads      113
6.2  The Executor framework     117
6.3  Finding exploitable parallelism      123

Chapter 7: Cancellation and Shutdown     135

7.1  Task cancellation      135
7.2  Stopping a thread-based service       150
7.3  Handling abnormal thread termination       161
7.4  JVM shutdown      164

Chapter 8: Applying Thread Pools     167

8.1  Implicit couplings between tasks and execution policies     167
8.2  Sizing thread pools      170
8.3  Configuring ThreadPoolExecutor     171
8.4  Extending ThreadPoolExecutor     179
8.5  Parallelizing recursive algorithms     181

Chapter 9: GUI Applications     189

9.1  Why are GUIs single-threaded?      189
9.2  Short-running GUI tasks     192
9.3  Long-running GUI tasks    &nb

For teachers

All the material you need to teach your courses.

Discover teaching material