Skip to main content

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

UD2.120 (Chavanne) | Day 1 | 17:00 - 17:30 | Speakers: Ayke van Laethem

Implementing parallelism: how we added threading and multicore support in TinyGo
A picture of a devroom at FOSDEM 2024
Open in browser

Notes

Abstract

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

Ayke van Laethem

Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.