hogosuru
hogosuru copied to clipboard
go-language-fatal-error-all-goroutines-are-asleep-deadlock
https://github.com/realPy/hogosuru/blob/ee8533a3b579978e160160fd61859aa80b6c1e89/promise/promise.go#L249
use with wg.Wait() no channels or select {} https://stackoverflow.com/questions/26927479/go-language-fatal-error-all-goroutines-are-asleep-deadlock
that's not the root of the problem at all. The concern is that channels in general shouldn't be used in webassembly because it's not true parallel processing. So he should prefer the use of promises instead. For me this is not an issue but a javascript stack constraint. This is a specific case of using go in webassembly. Are you affected by this problem? If your read the code of wg.Wait you can see it use semaphore and it will deadlock too in this specific situation.
I suggested to read the doc here https://hogosuru.v-ip.fr/guides/async-work-with-promise I explain the "thread mechanical" of js, some schema and how to sync with promise. My advice: In webassembly never use go channel except for the last line of "inifinite" waiting of code need by a wasm.
I don't know why or how , but i get error and my app crash , with waiting with "channels" or "select{}". just wg.Wait() work well for me.
And you are using Await?
yes
You can make a pr if you want. I will integrate it. This func is here for backward compatibilities and should be deprecated