LOADING

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

Scala Fibers, Java Virtual Threads, and Kotlin Coroutines - this talk shows how this elegant solution manifests at three different abstraction levels.

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 2
  —  
12:25 pm
arrow pointing right icon

Safer Code with LLMs: Scala Types Silver Bullet?

Code generation is one of the most promising applications of large language models (LLMs), offering substantial productivity boosts for developers. However, this benefit is tempered by serious concerns surrounding the correctness and security of the generated code - especially outside the happy path.

Day 2
  —  
9:35 am
arrow pointing right icon

Flexible Modeling: Keeping Your Domain Pure with Scala 3

In this talk, we will walk through a concrete example of a boilerplate-heavy domain. By replacing common Scala 2 workarounds with Opaque Types, Extension Methods, Enums, and Union Types, we will demonstrate how to achieve a strictly typed, decoupled architecture without the noise.

Day 2
  —  
10:10 am
arrow pointing right icon

Can we have the Standard Library for Macros?

Do you like it when compiler generates the boring code for you? Fast, mundane, boring-but-error-prone code? Do you need to implement such a code generator yourself? Have you found out that Shapeless/Mirrors bend your brain a bit too much?

Day 2
  —  
3:10 pm
arrow pointing right icon

Automating API Busywork with Scala

Writing client-facing APIs involves mundane tasks, whether it be REST, GraphQL, or gRPC. In this talk, I will pick two repetitive tasks during API development and demonstrate how we can utilize Scala to automate the most boring parts.

Day 2
  —  
2:35 pm
arrow pointing right icon

Scala and TypeScript Synergy: Developing a real-time collaborative text editor

In this presentation, I will demonstrate how we leveraged the strengths of Scala and TypeScript to develop a collaborative text editor that meets the strictest standards for security, performance, and real-time collaboration.

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