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.
alexcrichton commented on issue #10993:
One example is compiling a
Modulewhich inserts information within an engine. Do you have a specific operation you're worried about though?
sammyne commented on issue #10993:
One example is compiling a
Modulewhich 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.
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.
alexcrichton commented on issue #10993:
Ah for that you're fine, I believe it's just creating a new
Modulehas locks internally, but nothing else needs it.
Last updated: Dec 06 2025 at 06:05 UTC