Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm Execution Contexts now can be created while another thread is running a Wasm module #41

Merged
merged 3 commits into from
Mar 31, 2023

Conversation

gzurl
Copy link
Contributor

@gzurl gzurl commented Mar 29, 2023

This PR fixes #40: A new thread (from a new incoming HTTP request) could not create a new Wasm execution context while another thread was running a Wasm module. This was only measurable if the execution of the Wasm module was long enough in time or if it took longer than expected (i.e.: I/O issues, infinite loop, etc.). Note that CPU-limited Wasm executions are not implemented yet (see #9).

In the proposed implementation, the executing thread will extract and own its Wasm Execution Context and free the mutex over the Wasm Execution Contexts HashMap. Once is done with execution, the Context will be pushed again into the HashMap.

@gzurl gzurl changed the title Wasm Execution Contexts now can be crerated while another thread is running a Wasm module Wasm Execution Contexts now can be created while another thread is running a Wasm module Mar 29, 2023
@gzurl gzurl requested a review from juamedgod March 31, 2023 08:23
wasm_runtime/src/execution_ctx.rs Show resolved Hide resolved
wasm_runtime/src/execution_ctx.rs Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@gzurl gzurl merged commit 5cbbbfc into main Mar 31, 2023
@gzurl gzurl deleted the gzurl/exec_ctx branch April 21, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't create new Wasm Execution Contexts while another thread is running an existing Execution Context
3 participants