Stream: git-wasmtime

Topic: wasmtime / issue #10993 What operations will mutate Engin...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2025 at 08:00):

sammyne opened issue #10993:

Reading the docs https://docs.wasmtime.dev/contributing-architecture.html#trampolines as

wasmtime::Engine - this is a global compilation context which is sort of the "root context". An Engine is typically created once per program and is expected to be shared across many threads (internally it's atomically reference counted). Each Engine stores configuration values and other cross-thread data such as type interning for Module instances. The main thing to remember for Engine is that any mutation of its internals typically involves acquiring a lock, whereas for Store below no locks are necessary.

Just wondering which operations will mutate Engine's internals.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2025 at 14:46):

alexcrichton commented on issue #10993:

One example is compiling a Module which inserts information within an engine. Do you have a specific operation you're worried about though?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 02:13):

sammyne commented on issue #10993:

One example is compiling a Module which inserts information within an engine. Do you have a specific operation you're worried about though?

Just want to figure out scenarios where sharing an engine may cause its inner lock to hurt performance of calling funcs.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 14:35):

alexcrichton closed issue #10993:

Reading the docs https://docs.wasmtime.dev/contributing-architecture.html#trampolines as

wasmtime::Engine - this is a global compilation context which is sort of the "root context". An Engine is typically created once per program and is expected to be shared across many threads (internally it's atomically reference counted). Each Engine stores configuration values and other cross-thread data such as type interning for Module instances. The main thing to remember for Engine is that any mutation of its internals typically involves acquiring a lock, whereas for Store below no locks are necessary.

Just wondering which operations will mutate Engine's internals.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 14:35):

alexcrichton commented on issue #10993:

Ah for that you're fine, I believe it's just creating a new Module has locks internally, but nothing else needs it.


Last updated: Dec 06 2025 at 06:05 UTC