Skip to content

Conversation

yamt
Copy link
Contributor

@yamt yamt commented Aug 12, 2025

upsides:

  • by avoiding direct accesses to the TLS, increase the chances for third-party libraries to provide a single binary for threaded and non-threaded wasi targets. see [1] for an example.

downsides:

  • increase the overhead of errno accesses. i suppose it isn't critical as errno is typically only accessed in the error handling logic. there are a few apis like strtoul which require errno accesses even in successful cases though.

[1] https://github.com/bytecodealliance/wasm-micro-runtime/blob/d95b0e3d46da8e88f484f236cb4222f5a6dc5926/core/iwasm/libraries/lib-socket/src/wasi/wasi_socket_ext.c#L15-L33

upsides:

* by avoiding direct accesses to the TLS, increase the chances for
  third-party libraries to provide a single binary for threaded
  and non-threaded wasi targets. see [1] for an example.

downsides:

* increase the overhead of errno accesses. i suppose it isn't critical
  as errno is typically only accessed in the error handling logic.
  there are a few apis like strtoul which require errno accesses even
  in successful cases though.

[1] https://github.com/bytecodealliance/wasm-micro-runtime/blob/d95b0e3d46da8e88f484f236cb4222f5a6dc5926/core/iwasm/libraries/lib-socket/src/wasi/wasi_socket_ext.c#L15-L33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant