Member-only story

Java 19 Virtual Thread — Should you use it?

Yash Bansal
4 min readFeb 8, 2024

--

This blog is Part 1 of a 2 part series, explaining what are virtual threads in Java 19, how can virtual threads improve application performance and finally some benchmarking using virtual threads.

What are virtual threads :

Since ChatGPT is the new Google, let’s ask it about the definition of “Virtual Threads in Java19” (it gave different and meaningful definitions every time, kudos to the creators of this beauty !!!)

Virtual threads are a type of lightweight threads in Java 19. Virtual threads allow users to create a large number of threads, without experiencing the overhead associated with traditional threads. Virtual threads are managed by the Java Virtual Machine, so they can be reused as needed and enable substantial performance improvements when compared to using traditional native threads.

For GoLang lovers out there, virtual threads to go-routine is nothing but ‘Brother from Another Mother’

Why Virtual threads are useful

Java virtual threads are different from the original platform threads in the sense that virtual threads are much

--

--

Yash Bansal
Yash Bansal

Written by Yash Bansal

100K+ views, Principal Engineer, Loves to read and write about latest tech, sometimes about life topics . Find me on Topmate - https://topmate.io/yashbansal042

Responses (1)