Stream: git-wasmtime

Topic: wasmtime / PR #2709 Fix some issues around TLS management...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 05 2021 at 21:57):

alexcrichton opened PR #2709 from manage-tls-better to main:

This commit fixes a few issues around managing the thread-local state of
a wasmtime thread. We intentionally only have a singular TLS variable in
the whole world, and the problem is that when stack-switching off an
async thread we were not restoring the previous TLS state. This is
necessary in two cases:

The stack switching issue necessitates some more glue around suspension
and resumption of a stack to ensure we save/restore the TLS state on
both sides. The thread issue, however, also necessitates that we use
#[inline(never)] on TLS access functions and never have TLS borrows
live across a function which could result in running arbitrary code (as
was the case for the tls::set function.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2021 at 00:33):

peterhuene submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2021 at 16:25):

alexcrichton updated PR #2709 from manage-tls-better to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2021 at 17:32):

alexcrichton merged PR #2709.


Last updated: Oct 23 2024 at 20:03 UTC