Running on Java 22-ea+27-2262 (Preview)
Home of The JavaSpecialists' Newsletter

Mastering Virtual Threads in Java (Loom) Course

Write superscalable code in Java with Project Loom

Using Java 21

Duration of 1 Day


Virtual threads revolutionize how we write scalable systems. In this one-day course, we learn how virtual threads work, using our knowledge of platform threads as a basis.

Each section is followed by practical exercises, where we can try out what we have learned.

Mastering Virtual Threads in Java Enquiry


Prerequisites

This course is ideally suited to the professional Java programmer who is already very familiar with Java Platform Threads. Knowledge of Java 17 is helpful, but not a requirement.

  • Required Experience: At least two years of professional Java programming.

Pricing Options

We have several options for you to join this course:

1. Virtual In-house Course:

Presented via video conference to your team of programmers by the author of the course. Price is €4730 for up to 10 students, above that is an additional €473 per student.

  • Example 1: Course with 8 students taught remotely via video conference, price is €4730. Price per student is €591.
  • Example 2: Course with 12 students taught remotely via video conference, price is €5676. Price per student is €473.
  • Example 3: Course with 24 students taught remotely via video conference, price is €11352. Price per student is €473.

Please contact us if you have any questions.

2. In-person In-house Course:

Presented at your company in-person by one of our Certified JavaSpecialist Instructors. Price is €6970 for up to 10 students, above that is an additional €697 per student, plus the travel expenses of the instructor. Note that for in-person in-house courses, we need a minimum of three consecutive training days.

  • Example 1: Course with 8 students taught on-site at your company, price is €6970. Price per student is €871.
  • Example 2: Course with 12 students taught on-site at your company, price is €8364. Price per student is €697.
  • Example 3: Course with 18 students taught on-site at your company, price is €12546. Price per student is €697.

Please contact us if you have any questions.

2. Open Enrollment Classroom Course:

We occasionally offer this course as a classroom course in Chania on the Island of Crete. Price for the course is €1394 per student.

We also offer this course as an open enrollment live remote course that you can attend from anywhere. Price is €941 per student.

Please contact us if you have would like to make a booking or if you have any questions.

4. Self-Paced Course:

This course is currently not available as a self-paced course.

Please contact us if you have any questions.

* Prices exclude EU VAT and withholding taxes where applicable. Please contact us for an exact quote for your country.

Open Courses

All our courses are offered as in-house courses. Please contact us on heinz@javaspecialists.eu.

Location Dates Presenter Language Fees

* Price is excluding EU VAT where applicable. Please contact us for an exact quote for your country.

Detailed Outline

Part 0: Welcome
Part 1: Introduction to Virtual Threads
  • 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
Part 2: Changes in java.util.concurrent
  • 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
Part 3: Structured Concurrency
  • What is Structured Concurrency?
  • Example of Unstructured Concurrency
  • Subtask
  • join()
  • ShutdownOnFailure vs ShutdownOnSuccess
  • Custom shutdown policies
  • Deadlines
  • Fan-in Scenarios
  • Observability
Part 4: Scoped Values
  • 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
Part 5: Tips and Tricks
  • 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
Part 6: Virtual Thread Problems
  • Deadlocks
  • Pinned Threads
  • Race conditions
  • Memory
Part 7: Conclusion

About the Author

Heinz Kabutz Java Conference Speaker

Java Champion, author of the Javaspecialists Newsletter, conference speaking regular... About Heinz

Superpack '23

Superpack '23 Our entire Java Specialists Training in one huge bundle more...

Free Java Book

Dynamic Proxies in Java Book

110% Money-back Guarantee

Should you not be satisfied with the quality of the training or the delivery, we will gladly refund you 100% of the course fees. This needs to be brought to our attention within the first 4 hours of the course and a chance should be given to correct whatever you are not satisfied with. If you are still not satisfied, we will refund you 100% of the course fees, plus we will pay our own travel expenses. The training material then remains the property of JavaSpecialists.EU.


Cancellation Policy

If the course is cancelled more than two weeks before the start of the course, a 10% cancellation fee of the fees will apply, plus any non-refundable travel expenses incurred by the trainer.

If the course is cancelled within two weeks of the start of the course, a 50% cancellation fee of the fees will apply, plus any non-refundable travel expenses incurred by the trainer.

No refund will be given to cancellations during the course.


Java Training

We deliver relevant courses, by top Java developers to produce more resourceful and efficient programmers within their organisations.

Java Consulting

We can help make your Java application run faster and trouble-shoot concurrency and performance bugs...