Balkrishna Rawool
ING
Speaker at GOTO Amsterdam 2023

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.

Talks at GOTO Amsterdam 2023

Balkrishna is currently working at ING Bank as an IT Chapter Lead and he has been in the software industry for 18 years. He enjoys crafting elegant solutions while solving complex challenges. Although he has been working with Java for many years, he finds latest developments in Java quite exciting. He has passion for continuous learning and genuine desire to sharing knowledge. He is currently leading a team that is building a Credit Decisioning Engine for business-customers. Previously, he has served many clients in financial services sector while working at a technology consulting company. In his free time, he enjoys playing chess. The analytical thinking and foresight used in chess is something he finds useful in software development.