Skip to content
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

Question: proxy-wasm-go is thread safe or not? #368

Closed
dozer47528 opened this issue Mar 27, 2023 · 2 comments
Closed

Question: proxy-wasm-go is thread safe or not? #368

dozer47528 opened this issue Mar 27, 2023 · 2 comments

Comments

@dozer47528
Copy link

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
Copy link
Member

mathetake commented Mar 27, 2023

Proxy-Wasm in general is single threaded, not Go specific.

@mathetake
Copy link
Member

Please read the doc before opening issue

@tetratelabs tetratelabs locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants