top of page
< Back

Coroutine Suspension Mechanics: The State Machine within

Status: Accepted

Let's gaze inside a Kotlin Coroutine structure and see the Finite State Machine (FSM) inside it. Suspension mechanics revealed.

Beneath the elegant syntax, suspending functions hide a powerful state machine transformation that the Kotlin compiler generates. This transformation can feel magical, so our goal here is to demystify how Coroutine suspension works and reveal the mechanics behind it.

We'll explore how the compiler transforms suspending functions into state machines, how local variables persist across suspensions, and how cancellation and exception handling integrate with this system.

By the end of this talk, attendees will understand the internal mechanics of coroutine suspension, enabling them to write more efficient asynchronous code, debug coroutine issues more effectively, and make better decisions about suspension points in their applications.

Speakers

Andrea Della Porta

Mobile Technical Leader @ Cegeka

Ioannis Anifantakis

Senior Engineer @ Deloitte Digital

bottom of page