[WASM] wasm export func block until other goroutinue exit, this behavior not same go,go will exit right now and not block other goroutinue #4874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
if move code to
build it not use c-shared
greet.go
run this code
|
@aykevl could you look this problem about wasm,thanks |
I can confirm this bug. Simplified code: package main
import (
"runtime"
"time"
)
// main is required for Go to compile to Wasm.
func main() {}
//go:wasmexport greet
func _greet() {
go func() {
println("inside goroutine")
time.Sleep(time.Second*2)
println("exiting goroutine")
}()
runtime.Gosched()
println("exiting greet function")
} Go command:
TinyGo:
The proposal (golang/go#65199) says the following:
So |
See: #4875 |
Tagging to close this issue after next release. |
env
example code
greet_wasm.go
greet.go
build wasm
run code
hope
i need wasm exit not block other goroutinue by tinygo build
The text was updated successfully, but these errors were encountered: