You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
- TinyGo allows us to disable GC, but we cannot do that since we need to use maps (implicitly causes allocation)
98
-
for saving the plugin's [state](https://github.com/tetratelabs/proxy-wasm-go-sdk/blob/master/proxywasm/vmstate.go#L17-L22).
101
+
for saving the plugin's [state](https://github.com/tetratelabs/proxy-wasm-go-sdk/blob/cf6ad74ed58b284d3d8ceeb8c5dba2280d5b1007/proxywasm/vmstate.go#L41-L46).
99
102
- Theoretically, we can implement our own GC algorithms tailored for proxy-wasm through `alloc(uintptr)`[interface](https://github.com/tinygo-org/tinygo/blob/v0.14.1/src/runtime/gc_none.go#L13)
100
103
with `-gc=none` option. This is the future TODO.
101
104
-`recover` is [not implemented](https://github.com/tinygo-org/tinygo/issues/891) in TinyGo, and there's no way to prevent the WASM virtual machine from aborting.
102
-
-Be careful about using Goroutine
105
+
- Goroutine support
103
106
- In Tinygo, Goroutine is implmeneted through LLVM's coroutine (see [this blog post](https://aykevl.nl/2019/02/tinygo-goroutines)).
104
-
- Make every goroutine exit as soon as possible, otherwise it will block the proxy's worker thread. That is too bad for processing realtime network requests.
105
-
- We strongly recommend that you implement the `OnTick` function for any asynchronous task instead of using Goroutine so we do not block requests.
107
+
- In Envoy, WASM modules are run in the event driven manner, and therefore the "scheduler" is not executed once the main function exits.
108
+
That means you cannot have the expected behavior of Goroutine as in ordinary host environments.
109
+
- The question "How to deal with Goroutine in a thread local WASM VM executed in the event drive manner" has yet to be answered.
110
+
- We strongly recommend that you implement the `OnTick` function for any asynchronous task instead of using Goroutine.
111
+
- The scheduler can be disabled with `-scheduler=none` option of TinyGo.
0 commit comments