Stream: general

Topic: tinygo and yielding to another goroutine


view this post on Zulip Joel (Oct 16 2025 at 05:38):

Is it going to be possible to have multiple goroutines in wasip2? I can't seem to get multiple goroutines to run when I block on a poll in a single Goroutine. Blocking on a poll blocks all goroutines. If I just run a for loop with no blocking until the cpu core is maxed out, I still cannot get other goroutines to run. Is this something i just have to wait for wasip3 for?

view this post on Zulip Lann Martin (Oct 16 2025 at 13:06):

Goroutines work but only where tinygo itself supports the concurrent operations involved. I assume that from tinygo's perspective your poll looks like any other blocking import call so it doesn't have a chance to run its scheduler.

view this post on Zulip Lann Martin (Oct 16 2025 at 13:08):

Also: https://tinygo.org/docs/concepts/compiler-internals/datatypes/#goroutine

For WebAssembly, we use Asyncify. This works most of the time, but can result in some weird edge cases.


Last updated: Dec 06 2025 at 05:03 UTC