{"id":355135,"date":"2023-05-15T21:41:21","date_gmt":"2023-05-15T20:41:21","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=idea&#038;p=355135"},"modified":"2023-12-13T15:46:51","modified_gmt":"2023-12-13T14:46:51","slug":"new-livestream-virtual-threads-and-structured-concurrency-in-java-2021-with-loom","status":"publish","type":"idea","link":"https:\/\/blog.jetbrains.com\/fr\/idea\/2023\/05\/new-livestream-virtual-threads-and-structured-concurrency-in-java-2021-with-loom","title":{"rendered":"New Livestream: Virtual Threads and Structured Concurrency in Java 21 With Loom"},"content":{"rendered":"\n<p><em>Updated on 13\/12\/2023.<\/em><\/p>\n\n\n\n<p>On May 25, 2023, we hosted our IntelliJ IDEA LiveStream with Jos\u00e9 Paumard to learn how to work with virtual threads.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Virtual Threads and Structured Concurrency in Java 21 With Loom\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/QxxG66eQoTc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Session abstract<\/h2>\n\n\n\n<p>Loom brought 2 preview features in Java 19: virtual threads and structured concurrency. Virtual threads are a new model of thread that is compatible with the current platform threads but much lighter. You can easily launch millions of virtual threads on a machine that would only support a few thousand platform threads. Virtual threads should be made final in JDK 21. Structured concurrency leverages this feature to write asynchronous code in a very easy way. It is built on an imperative mono-thread programming model built on top of virtual threads. These elements have been updated in Java 20. Java 20 also has a third preview feature delivered by the Loom project: a new model for ThreadLocal variables called ScopedValues that is meant to work with virtual threads. This presentation shows you how this all works, the new pattern you will be able to use for your asynchronous systems, and the performance you may expect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Asking questions<\/h2>\n\n\n\n<p>Jos\u00e9 will try to answer all of your questions during the session. If we run out of time, we\u2019ll post the answers to any remaining questions in a follow-up blog post. We\u2019ll do our best to get all of your questions answered.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Your speaker and host<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Speaker<\/h2>\n\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                                                            <div class=\"about-author__box-img\">\n                            <img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/05\/JosePaumard.jpg\" alt=\"Jose Paumard\" loading=\"lazy\">\n                        <\/div>\n                                        <div class=\"about-author__box-text\">\n                                                    <h4>Jos\u00e9 Paumard<\/h4>\n                                                <p><span style=\"font-weight: 400;\">Jos\u00e9 works as Java Developer Advocate at Oracle. With a PhD in applied mathematics and computer science, he was an assistant professor at the University Sorbonne Paris Nord for 25 years, and is now a Java Champion Alumnus and JavaOne Rockstar. He is a member of the French Paris Java User Group, has been a co-organizer of the Devoxx France conference, and is a disorganizer of JChateau, an unconference held in the Chateau of the Loire Valley. He works on the dev.java documentation website and publishes the JEP Caf\u00e9, a monthly video cast on YouTube. He is also a Pluralsight author in the Java space.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Speaker Twitter handle: <\/span><a href=\"https:\/\/twitter.com\/JosePaumard\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">twitter.com\/JosePaumard<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Speaker Github repo: <\/span><a href=\"https:\/\/github.com\/JosePaumard\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">github.com\/JosePaumard<\/span><\/a><\/p>\n                    <\/div>\n                            <\/div>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Host<\/h2>\n\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                                                            <div class=\"about-author__box-img\">\n                            <img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/11\/Mala-Gupta-e1595919910139-edited.jpeg\" alt=\"\" loading=\"lazy\">\n                        <\/div>\n                                        <div class=\"about-author__box-text\">\n                                                    <h4>Mala Gupta<\/h4>\n                                                <p><span style=\"font-weight: 400;\">A Java Champion and JUG leader, <\/span><a href=\"https:\/\/twitter.com\/eMalaGupta\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Mala<\/span><\/a><span style=\"font-weight: 400;\"> has authored multiple books with Manning, Packt, and O\u2019Reilly Publications. An international speaker at industry conferences, she has more than 2 decades\u2019 experience in the software industry. She has been actively supporting Java certification as a path to career advancement.<\/span><\/p>\n                    <\/div>\n                            <\/div>\n        <\/div>\n    <\/div>\n\n\n<p>Happy developing!<\/p>","protected":false},"author":746,"featured_media":357505,"comment_status":"closed","ping_status":"closed","template":"","categories":[6460,30],"tags":[],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea\/355135"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/types\/idea"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/users\/746"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/comments?post=355135"}],"version-history":[{"count":9,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea\/355135\/revisions"}],"predecessor-version":[{"id":418620,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea\/355135\/revisions\/418620"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/media\/357505"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/media?parent=355135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/categories?post=355135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/tags?post=355135"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/cross-post-tag?post=355135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}