JuliaCon 2025

Cancellation, AKA the Big Red Button
2025-07-24 , Main Room 5

What do you do when everything goes to crap? You hit the big red button, of course! Otherwise known as Ctrl-C, we'll discuss what Ctrl-C does, why it does its job poorly, and how cancellation can help your library or application become much better behaved when the world around them lights on fire!


Runaway code is familiar to all - maybe due to programmer error, user error, or just a little cosmic bit flip - the result is that the user can't do what they want to do, and so they need to wrestle back control of their system. Everyone knows about the wonders of Ctrl-C and how it can save a session from an infinite descent into madness, but not everyone realizes the lasting damage that Ctrl-C can cause. Memory corruption, segfaults, unexpected behavior - these are just some of the terrible things that can happen to a Julia session which has been sent a Ctrl-C interrupt. But there is a better way!

In this session, we'll discuss what Ctrl-C does in simple terms, and why that is really not always what we really want it to do. We'll then learn about cancellation, how it's used to make code robust to failures and runaway code, and how it can be used to build more bulletproof libraries and applications. We'll also cover the downsides of cancellation, and how some of these downsides can be mitigated with good interface design.

RSE at MIT's JuliaLab, author of AMDGPU.jl, and maintainer of Dagger.jl. I want to improve the accessibility of HPC so that everyone can easily and productively scale their code to the max!

This speaker also appears in: