Question: proxy-wasm-go is thread safe or not?
dozer47528 opened this issue · 2 comments
dozer47528 commented
Hi tetratelabs team, I am learning wasm-go from this example.
But I am worried about these two lines, which may change the slice at the same time.
https://github.com/tetratelabs/proxy-wasm-go-sdk/blob/main/examples/postpone_requests/main.go#L62
https://github.com/tetratelabs/proxy-wasm-go-sdk/blob/main/examples/postpone_requests/main.go#L89
For normal golang code, I need to use sync.Mutex
.
It is safe in wasm-go? Why?
mathetake commented
Proxy-Wasm in general is single threaded, not Go specific.
mathetake commented
Please read the doc before opening issue