Skip to content

Remove rwlock around instantiating a module within a store #4025

Description

@alexcrichton

Currently whenever a module is instantiated within a store for the first time it will register itself within the global map of all modules so the signal handlers have a way to go from a faulting address to determine whether it's a wasm pc that should have faulted. This operation, however, is quite costly relative to many other things wasmtime does, especially because pthread rwlocks aren't necessarily known for their speed.

Instead we should probably skip this lock altogether. Instead we should probably perform the global registration task when a Module is created rather than when a Module is instantiated for the first time within a store. This will remove both the rwlock used when a module is instantiated as well as when a store is dropped and the module is unregistered in the global map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasmtimeIssues about wasmtime that don't fall into another label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions