Brussels / 1 & 2 February 2025

schedule

Implementing parallelism: how we added threading and multicore support in TinyGo


Parallelism is hard. So until recently, TinyGo (the alternative Go compiler for small systems) simply did not implement it. Instead, we used a simple single threaded scheduler that provides concurrency, but not parallelism. This made all programs act like GOMAXPROCS=1, which caused some practical issues.

Over the past few months we added support for running multiple goroutines in parallel on Linux, MacOS, and on the dual-core RP2040 chip. This required changes in many parts of TinyGo that previously assumed single threaded operation.

This talk will cover a variety of topics that may be interesting to anybody who wants to learn about low level primitives:

  • Which parts of Go are affected by parallelism.
  • Futexes: the building block of concurrency primitives on modern operating systems.
  • How some synchronisation primitives like channels and sync.Mutex are implemented in TinyGo.
  • How parallelism is implemented in TinyGo on Linux, MacOS, and the RP2040 chip.

Speakers

Photo of Ayke van Laethem Ayke van Laethem

Links