From 532b66b03ac03b00e4e13b1836e7daec3a0f4bb7 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 29 Sep 2025 15:17:32 +0200 Subject: [PATCH] tips-n-tricks: note that TinyGo can be multicore --- content/docs/guides/tips-n-tricks.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/docs/guides/tips-n-tricks.md b/content/docs/guides/tips-n-tricks.md index f43dcf03..0dcdef4f 100644 --- a/content/docs/guides/tips-n-tricks.md +++ b/content/docs/guides/tips-n-tricks.md @@ -8,8 +8,7 @@ description: | ## Ensure Concurrency -TinyGo code runs on a single core, in a single thread (think `GOMAXPROCS=1`). -Since scheduling in TinyGo is [cooperative](https://en.wikipedia.org/wiki/Cooperative_multitasking), a goroutine that never does IO or other blocking calls (f.ex. `time.Sleep()`) will lock the single available thread only for itself and never allow other goroutines to execute. In such cases, you can use `runtime.Gosched()` as a workaround. +In many cases (especially on microcontrollers), TinyGo is running on a single core with only [cooperative scheduling](https://en.wikipedia.org/wiki/Cooperative_multitasking). This means that a goroutine that never does IO or other blocking calls (f.ex. `time.Sleep()`) will lock the single available thread only for itself and never allow other goroutines to execute. In such cases, you can use `runtime.Gosched()` as a workaround. ``` package main