11

Concurrency ‒ Virtual Threads and Structured Concurrency: Diving Deeper

This chapter includes 18 problems meant to dive deep into how virtual threads and structured concurrency work and how they should be used in your applications.

If you don’t have a background in concurrency in Java then I strongly recommend postponing this chapter until you read some good introductory coverage on this topic. For instance, you could try out Chapter 10 and Chapter 11 from Java Coding Problems, First Edition.

We start this chapter by explaining how virtual threads work internally. This will be helpful to help you better understand the subsequent problems about extending and assembling StructuredTaskScope, hooking ThreadLocal and virtual threads, avoiding ...

Get Java Coding Problems - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.