7 Investigating locks in multithreaded architectures

 

This chapter covers

  • Monitoring an application’s threads
  • Identifying thread locks and what causes them
  • Analyzing threads that are waiting

In this chapter, we dive into the wild world of multithreaded architectures. If you’ve ever felt like threading is one of the trickiest parts of development, you're not alone. Even the best developers sometimes stare at their code, wondering why their threads behave like unsupervised toddlers. And just when you think you've got it working, making it performant is an entirely new level of pain.

But don’t worry! The techniques we discuss in this chapter will give you much-needed visibility into the execution of multithreaded apps, helping you pinpoint problems before they become production nightmares.

To get the most out of this chapter, you'll need a solid grasp of Java’s threading basics—things like thread states and synchronization. If you need a refresher, head over to appendix D. It won’t make you a concurrency guru overnight (that would require an entire bookshelf, plus some meditation), but it’ll arm you with enough knowledge to tackle the troubleshooting ahead.

7.1 Monitoring threads for locks

7.2 Analyzing thread locks

7.3 Analyzing waiting threads

7.4 Summary