-
Notifications
You must be signed in to change notification settings - Fork 668
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
Instruction metering #3927
Comments
Link similar things together. #2163 |
Passing the number of instructions to be executed seems to be the right approach. However, after inspecting the call stack of
In this final function, we can use the instruction count to exit the interpreter loop after executing N instructions and return (by propagating an additional variable to the initial call). However, I’m not exactly sure where the loop condition is checked within this
|
Feature
Similar to the Wasmer runtime, it would be beneficial to implement instruction metering, allowing control to be handed back to the caller after executing a specified number of instructions.
Benefit
This would enable on platform with a cooperative scheduler to manage how WASM code is executed, preventing system overload.
Implementation
Introduce a function like
wasm_func_call_with_metering
that returns an after a given number of executed instruction, a boolean indicating whether the function reached its end.Alternatives
None identified.
The text was updated successfully, but these errors were encountered: