liveBook · Manning

Chapter 9: Investigating locks in multithreaded architectures

What you will learn in chapter 9 of Troubleshooting Java: Read, debug, and optimize JVM applications

This introduction previews techniques for investigating execution and performance in multithreaded applications and identifies prerequisite threading knowledge.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction previews techniques for investigating execution and performance in multithreaded applications and identifies prerequisite threading knowledge.

9.1 Monitoring threads for locks

This section explains thread locks and uses a producer-consumer example and profiler timelines to show how synchronization affects execution.

Key terms: thread locks, thread synchronization, joining, blocking object, producer, consumer, monitor, synchronized block, Threads monitoring tab, thread timelines

9.2 Analyzing thread locks

This section uses sampling and lock profiling to identify thread contention and assess whether a multithreaded app’s execution suits its workload.

Key terms: sampling, total CPU time, self time, thread lock, Profiler tab, Locks button, monitor object, object reference, blocked thread, Monitor History

9.3 Analyzing waiting threads

This section distinguishes waiting from locked threads and uses profiling to evaluate a wait/notify change to a producer-consumer application.

Key terms: monitor, synchronized block, locked threads, waiting threads, notified, producer thread, consumer thread, wait(), notifyAll(), list

9.4 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 8: Using advanced visualization tools for profiled data Chapter 10: Investigating deadlocks with thread dumps →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.