From the course: Java Threads Demystified by Pearson
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Virtual threads - Java Tutorial
From the course: Java Threads Demystified by Pearson
Virtual threads
So, last of all, in the remaining few minutes, let's just talk briefly about virtual threads because these are new and although this is not course primarily about virtual threads, they do kind of change the picture that I've been painting for you a little bit. So, the idea of virtual threads is basically to replace the reactive programming model. This has been very successful, but I've already said that I'm not that happy about it. It handles the problem of IO blocking, but the cost is a very difficult programming model. The reason that we have to have it is because if we wanted to have a lot, we wanted to create a lot of threads, we wanted them all to wait on IO, all to be IO blocking, we would end up with far too many threads. You can't have thousands of platforms, all of them blocked and waiting for IO. So basically, what you have to do is you have to have this asynchronous reactive programming model in order to reduce the number of threads. I mean, there's a feature in NIO that…