Skip to content

Commit ce2e3d9

Browse files
aykevldeadprogram
authored andcommitted
tips-n-tricks: note that TinyGo can be multicore
1 parent 0a76a21 commit ce2e3d9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

content/docs/guides/tips-n-tricks.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ description: |
88

99
## Ensure Concurrency
1010

11-
TinyGo code runs on a single core, in a single thread (think `GOMAXPROCS=1`).
12-
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.
11+
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.
1312

1413
```
1514
package main

0 commit comments

Comments
 (0)