Java Virtual Threads

Ғылым және технология

Concurrent applications, those serving multiple independent application actions simultaneously, are the bread and butter of Java server-side programming. The thread has been Java’s primary unit of concurrency since its inception and is core to the entire Java platform. However, it can no longer efficiently represent a domain unit of concurrency. As a result, Java has seen a proliferation of libraries and frameworks that offer scalability while abandoning the thread as the unit of software concurrency-and, with it, the support of Java’s observability tooling. In this session, learn how Project Loom aims to reinstate the thread as an efficient unit of concurrency by adding a lightweight implementation of threads to the Java platform.
An Oracle DevLive Level Up - Java Developer Day session.
Presented by Sergey Kuksenko, Principal Member of Technical Staff
More info ➱ inside.java/tag/loom
More Level Up videos ➱ • Oracle DevLive Level U...
Tags: #Java #OpenJDK #JDK20 #concurrency

Пікірлер: 12

  • @kevindurant4952
    @kevindurant4952 Жыл бұрын

    01:10 Now it's possible to have millions of Java processes running concurrently. 04:28 Traditional threads are expensive, the solution could be asynchronous programming, but asynchronous programming has very intrusive downsides. 06:35 Project Loom tries to make Threads cheaper. 06:38 What is a Virtual Thread? Conclusion: they feel like normal Threads, it allows you not to care about the details underneath. 07:38 We call traditional Threads, Platform Threads. 08:39 Virtual Thread builder example and newVirtualThreadPerTaskExecutor() example. 09:26 Virtual Threads x Platform Threads x Sequential Benchmark. 12:15 Real Application Benchmark data. The higher the bar, the better the framework scores. 15:35 Little's Law, it works for stable systems, not for systems which continually grow. An example on how Thread-per-Request was their bottleneck in an application. 18:26 Little's Law Chart, Platform Threads x Virtual Threads throughput. 19:39 How to adopt Virtual Threads. Write synchronous code inside the task, as boring and as straightforward possible. 21:02 You should NOT pool Virtual Threads. If you need to pool, or rather limit async execution, use the Semaphore class. 22:10 Don't cache in ThreadLocals. Instead use Scoped Values. 24:10 Avoid pinning. 28:24 (end) How to adopt Virtual Threads frame. 28:54 Structured Concurrency, short intro. For Spring enthusiasts, an interesting blog post: spring.io/blog/2022/10/11/embracing-virtual-threads. This post shows how you can change the Thread-per-Request executor to a newVirtualThreadPerTaskExecutor.

  • @tanveerhasan2382

    @tanveerhasan2382

    Жыл бұрын

    Bless your heart

  • @sergeyshcherbakov3653
    @sergeyshcherbakov3653 Жыл бұрын

    Молодец, Серёга, хорошо объяснил !

  • @oneextrabit
    @oneextrabit Жыл бұрын

    Very informative and detailed! This talk can serve as a good summary as to why/when you should use VT.

  • @prunge
    @prunge Жыл бұрын

    Will be great when we can write performant concurrent code with this. Had to debug some Spring Webflux / Reactive stuff lately and it was not easy.

  • @FurkanAliUnal
    @FurkanAliUnal Жыл бұрын

    Thank you for informative videos

  • @juliandurchholz
    @juliandurchholz Жыл бұрын

    Will you introduce API to offer control over which executor a virtual thread should run on?

  • @CarlosSaltos
    @CarlosSaltos Жыл бұрын

    Cool T-shirt !! ... Cool talk !! 👍😎

  • @srinutippana
    @srinutippana Жыл бұрын

    Very informative

  • @jackgame8841
    @jackgame8841 Жыл бұрын

    really good talk

  • @dumdumdumdum8804
    @dumdumdumdum8804 Жыл бұрын

    Another language mojo is coming in the AI machine learning space, valhalla should come early or some struct like construct along with vector APIs otherwise java could never take off for AI/Machine learning space.

  • @fertiz_
    @fertiz_ Жыл бұрын

    hello

Келесі