pchickey opened PR #7797 from bytecodealliance:pch/engine_weak
to bytecodealliance:main
:
Engine is, internally, just an Arc<EngineInner>, so this is trivial to implement - EngineWeak is a Weak<EngineInner>.
This behavior is desirable because
Engine::increment_epoch
typically happens in a worker thread, which in turn requires additional machinery to discard theEngine
once it is no longer needed. If instead the worker thread holds anEngineWeak
, it can stop ticking when all consumers of theEngine
have dropped it. This has been documented as a suggestion inincrement_epoch
.For an example of additional machinery which is simplified by this change, see https://github.com/fastly/Viceroy/blob/25edee0700ec0b20b1b56db0a3a8d6f090397b3a/lib/src/execute.rs#L108-L116)
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
pchickey requested fitzgen for a review on PR #7797.
pchickey requested wasmtime-core-reviewers for a review on PR #7797.
fitzgen submitted PR review:
Sanity test for when it is expected to be upgradable and expected to not be?
pchickey updated PR #7797.
pchickey has enabled auto merge for PR #7797.
pchickey merged PR #7797.
Last updated: Dec 23 2024 at 13:07 UTC