`wasmtime` preemption

Hello, I want wasm binary to call a host function, that will pause execution of the current wasm function and call another wasm function on the same stack, exported from the binary. When second function finishes, runtime will continue with the first function - stack should remain unchanged because second function popped all frames.

I can't find apis that would allow me to do something like this. Fuel seems related but quite different.

I need this because I want to port RTIC to wasm.

The only thing that comes to mind is to create another wasm runtime, memcpy the whole address space and call interrupt handler on the second runtime, and after it finished memcpy the whole address space back. But maybe there is something better, and I'm not sure it would work.