Skip to content

Conversation

@dicej
Copy link
Contributor

@dicej dicej commented Oct 6, 2025

This has a few benefits:

  • No need to specify an instance when creating or piping from a stream or future.
  • No need to track the instance in an Accessor.
  • You may now execute tasks for multiple instances in a single event loop.

The main drawback is that, if one of several instances within a single store traps, it effectively means all instances have trapped, and the store can't be used to create new instances. The way to avoid that is to use separate stores for instances which must be isolated from others.

As a result of this change, a lot of code had to move from e.g. impl Instance to e.g. impl StoreOpaque, so the diff is pretty huge, but the changes themselves are almost entirely non-functional.

Fixes #11226
Fixes #11249
Fixes #11651

This has a few benefits:

- No need to specify an instance when creating or piping from a stream or future.
- No need to track the instance in an `Accessor`.
- You may now execute tasks for multiple instances in a single event loop.

The main drawback is that, if one of several instances within a single store
traps, it effectively means all instances have trapped, and the store can't be
used to create new instances.  The way to avoid that is to use separate stores
for instances which must be isolated from others.

As a result of this change, a lot of code had to move from e.g. `impl Instance`
to e.g. `impl StoreOpaque`, so the diff is pretty huge, but the changes
themselves are almost entirely non-functional.

Fixes bytecodealliance#11226

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej requested a review from alexcrichton October 6, 2025 17:30
@dicej dicej requested review from a team as code owners October 6, 2025 17:30
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
dicej added 2 commits October 6, 2025 12:30
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
- restore `ComponentStoreData` encapsulation
- avoid conditional code duplication in `LiftContext::new`

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej added this pull request to the merge queue Oct 6, 2025
Merged via the queue into bytecodealliance:main with commit 7e39c25 Oct 6, 2025
44 checks passed
@dicej dicej deleted the fix-11226 branch October 6, 2025 20:16
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
…lliance#11796)

* move `ConcurrentState` from `ComponentInstance` to `Store`

This has a few benefits:

- No need to specify an instance when creating or piping from a stream or future.
- No need to track the instance in an `Accessor`.
- You may now execute tasks for multiple instances in a single event loop.

The main drawback is that, if one of several instances within a single store
traps, it effectively means all instances have trapped, and the store can't be
used to create new instances.  The way to avoid that is to use separate stores
for instances which must be isolated from others.

As a result of this change, a lot of code had to move from e.g. `impl Instance`
to e.g. `impl StoreOpaque`, so the diff is pretty huge, but the changes
themselves are almost entirely non-functional.

Fixes bytecodealliance#11226

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* fix non-component-model-async build

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* fix outdated doc comment

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* address review feedback

- restore `ComponentStoreData` encapsulation
- avoid conditional code duplication in `LiftContext::new`

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

---------

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants