google / google/wasefire

Interpreter interruptions

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
crate:interpreter for:usability needs:design
Dominant language
Rust
Stars
188
Forks
41
Avg merge
1d 5h
Merged PRs (30d)
12

Description

There are multiple reasons for which the interpreter execution may need to be interrupted and control returned:
- Time slicing when running multiple non-cooperative applets. Applets have a time quota and the scheduler uses a hardware timer to switch applets when the quota is reached. Quota replenishes according to the scheduling strategy (round-robin, priorities, etc).
- Bounded interrupt latency. When an interrupt occurs and an applet has a handler registered, the interpreter needs to be paused (even outside a host function call) to execute that handler.

Design questions/ideas:
- There could be either a global or per-store atomic boolean set to true when the interpreter should return control.
- The interpreter should check this boolean often enough for bounded latency but not too often for performance. An option would be to check on every non-forward edge (i.e. branching to the beginning of a loop or calling a function).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.