Structured Concurrency in Java: The What & Why
This video is also available in the GOTO Play video app! Download it to enjoy offline access to our conference videos while on the move.
This talk introduces Virtual Threads and Structured Concurrency and explains their benefits and shortcomings. It compares Structured Concurrency API with CompletableFuture API by live coding multiple examples with both of these APIs.
Virtual threads are lightweight user threads, enabling Java applications to produce thousands (or even millions) of threads. Also, they are super-efficient as they don't block their 'carrier' threads. These two characteristics of virtual threads let application developers focus on business requirements rather than managing platform threads (for example, with thread-pools etc.) which enables Structured Concurrency.
With structured concurrency, we can let each business-task be executed by a separate virtual thread and structure these virtual threads in any logical way that we want. It provides us with control structures for managing our virtual threads and simplifies applications that use concurrency.
A big part of the talk is live coding where multiple examples are first implemented with CompletableFuture and then with Structured Concurrency API. For each example, these two implementations are then compared. These examples highlight that CompletableFuture’s reactive-like API relies on callbacks whereas Structured Concurrency puts forward an imperative-like API which is easier to read and reason.
All in all, this talk introduces virtual threads and structured concurrency to the audience and explains why one should seriously consider using it.
-
Failure Is Always An OptionDylan BeattieThursday Jun 29, 15:40
-
Small Steps Are the Fastest Way Forward: Life Beyond Agile & ScrumSander HoogendoornThursday Jun 29, 13:30
-
Programming's Greatest MistakesMark RendleWednesday Jun 28, 16:40
-
Demystifying Blockchain - From Infrastructures Via Smart Contracts to ApplicationsOlivier RikkenTuesday Jun 27, 14:20
-
Privacy, Crime, National Security, Human Rights & You in the MiddleBert HubertTuesday Jun 27, 16:40
-
The Flight Plan to Emission Free AviationDr. Anita SenguptaTuesday Jun 27, 09:10
-
Developing and Maintaining Your Own BrainErik ScherderWednesday Jun 28, 09:10
-
One Rule to Rule Them AllDave ThomasThursday Jun 29, 09:10
-
How The Hack?Ben SadeghipourWednesday Jun 28, 13:20
-
Industry Myth BustingJoris KuipersTuesday Jun 27, 13:20