LOADING

The Concurrency Triangle: Scala Fibers, Java Virtual Threads, and Kotlin Coroutines

Riccardo Cardin
Senior Software Engineer at Lastminute.com, Blogger at RockTheJvm.com
About This Talk

Operating system thread context switches are a fundamental bottleneck in high-concurrency JVM applications. Each switch requires kernel transitions, CPU cache invalidation, and scheduling overhead. The JVM ecosystem has developed three prominent solutions: Fibers as implemented by many Scala monadic effect systems, Java Virtual Threads (Project Loom), and Kotlin Coroutines.

While these technologies appear vastly different on the surface, functional versus imperative, library versus runtime, they actually implement the same core pattern: replacing OS thread scheduling with user-space scheduling of continuations.

This talk shows how this elegant solution manifests at three different abstraction levels. We'll take the Cats Effect library as an example of Fibers implementation library through the IO monad. Project Loom pushes it down to the JVM runtime, making it transparent to developers. In Scala, the Ox library is built upon virtual threads. Kotlin Coroutines place it at compile time through the transformation of suspend functions. We'll see them as different expressions of the same fundamental breakthrough in concurrent programming.

more great talks

Might Be Interesting

Day 1
  —  
arrow pointing right icon

The world after Scala 3.9 LTS

In this talk, I will introduce the highlights of what to look forward to in Scala 3.9 LTS, as well as how to think about the upcoming new release.

Day 1
  —  
arrow pointing right icon

Migration Without Tears: 2,000 Projects, One New LTS

In this talk, I will present insights from running the Open Community Build, where we continuously build and migrate nearly 2,000 open-source projects to the newest Scala Next versions, from scratch, every week.

Day 1
  —  
arrow pointing right icon

Efficient programming with Scala and LLMs

Drawing from multiple Scala LLM workshops we conducted this past year, I will share insights to significantly enhance your AI experience.

Day 1
  —  
arrow pointing right icon

NamedTuples in Action

I would like to present the use of NamedTuples to implement some cool things in SQL Libraries

See All Events
Join us!

We're looking for amazing speakers.
CFP is open till 10.01.2023

Fill in Call for Papers
location icon

Location

Centrum Konferencyjne POLIN, Poland
stay in touch icon

Follow Us

Contact Us