Skip to content
  • Sign In
  • Try Now
View all events
Java

Mastering Virtual Threads in Java with Project Loom

Published by Pearson

Advanced content levelAdvanced

Revolutionize your Coding of Scalable Systems with Virtual Threads

  • Apply virtual threads to solve real-world scenarios and troubleshoot common issues
  • Work through practical exercises for hands-on learning, preparing you for practical challenges in software development
  • Deep dive into advanced features of Project Loom like structured concurrency and scoped values, equipping you with skills for modern Java applications

This course on Mastering Virtual Threads in Java through Project Loom, a lightweight concurrency construct to Java, offers an in-depth look at leveraging concurrency for developing high-performance Java applications. It covers key concepts like virtual threads, structured concurrency, and scoped values, emphasizing a hands-on approach with practical exercises. This training is pivotal for developers aiming to enhance their skills in modern concurrent programming techniques, ensuring they can build more efficient, scalable, and maintainable Java applications. By mastering these advanced features, participants are well-equipped to address the complexities of today's software development challenges, making this class a vital resource for staying competitive in the field.

What you’ll learn and how you can apply it

  • How to utilize virtual threads in Java applications to improve scalability and manage concurrency with greater efficiency
  • How to implement structured concurrency and scoped values to write cleaner, more maintainable code that easily handles complex, asynchronous tasks
  • How to troubleshoot and optimize Java applications by understanding and resolving common concurrency issues, such as deadlocks and memory management challenges

This live event is for you because...

  • This live event is for you because you are a Java software developer seeking to enhance your concurrency programming skills, dive into the latest advancements in Java with Project Loom, and tackle modern software challenges with innovative solutions. Whether you're looking to make your existing applications more efficient and scalable or aiming to stay ahead in the rapidly evolving field of software development, this training will provide the knowledge and tools needed to master virtual threads and structured concurrency. Perfect for intermediate to advanced Java developers, this course will elevate your programming expertise to the next level.

Prerequisites

  • A general understanding of Java platform threads.

Recommended Preparation

Recommended Follow-up

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Segment 1: Introduction to Virtual Threads (35 min)

  • What is a Virtual Thread?
  • Daemon Threads
  • Carrier Threads
  • Builders for Threads
  • Properties for platform vs virtual threads
  • Timers with Virtual Threads
  • java.lang.ref.Cleaner
  • GC Roots
  • Parallel vs Concurrent Computing
  • Best deal search demo
  • States of platform vs virtual threads
  • Exercises and Q&A spread throughout section

Break: 5 min

Segment 2: Changes in java.util.concurrent (42 min)

  • AutoCloseable ExecutorService
  • Using ExecutorService with Deadline
  • ManagedBlocker
  • Locking in Virtual Threads
  • Synchronized -> ReentrantLock
  • Blocking whilst synchronized - Pinned
  • What code should be migrated
  • Debugging with -Djdk.tracePinnedThreads
  • Exercises and Q&A spread throughout section

Break: 5 min

Segment 3: Structured Concurrency (45 min)

  • What is Structured Concurrency?
  • Example of Unstructured Concurrency
  • Subtask
  • join()
  • ShutdownOnFailure vs ShutdownOnSuccess
  • Custom shutdown policies
  • Deadlines
  • Fan-in Scenarios
  • Observability
  • Exercises and Q&A spread throughout section

Break: 5 min

Segment 4: Scoped Values (25 min)

  • What are Scoped Values?
  • Problem with thread locals
  • Lightweight sharing
  • Immutability
  • What does "scoped" mean?
  • Rebinding scoped values
  • Scoped values as capabilities
  • Inheriting scoped values
  • Migrating to scoped values
  • Exercises and Q&A spread throughout section

Break: 5 min

Segment 5: Tips and Tricks (35 min)

  • Stopping Threads
  • Java IO Implementations Rewritten
  • Things to know about Virtual Threads
  • Changes in Future
  • Interruptible IO
  • Reflection rewritten
  • Thread dump without safe point
  • Stack Depth
  • ThreadGroup
  • Exercises and Q&A spread throughout section

Break: 5 min

Segment 6: Virtual Thread Problems (25 min)

  • Deadlocks
  • Pinned Threads
  • Race conditions
  • Memory
  • Exercises and Q&A spread throughout section

Segment 7: Conclusion (5 min)

Your Instructor

  • Heinz Kabutz

    Heinz Kabutz is the author of The Java Specialists' Newsletter, where he explores interesting tips and tricks from the Java Programming Language. Please join his newsletter on www.javaspecialists.eu.

    linkedinXlinksearch