You can find the code of the demo here: https://github.com/JosePaumard/Loom_demo
The Loom project has been under work for several years now. Preview versions are available, that give an idea of what it will bring to the Java platform. We can see what patterns we will be able to use, and the performances it will bring. Our good old Threads, created more than 25 years ago, will see a new kind of lightweight threads. Creating a thread will be easier and much cheaper, allowing the creation of millions of them in a single JVM. These new virtual threads bring with them new notions, that will be covered in this talk. You will see structured concurrency, reactive and asynchronous programming, how you can create actors on this new concurrent programming model. You will learn about ScopeLocal, a new way of dealing with ThreadLocal variables, about StructuredExecutor, and about synchronization. A lot of code is shown in this presentation, you will see how Loom can change the way you write your code, the performance gains you may expect, both in your application and for the Java Virtual Machine itself.