Why is handling an #OS #Signal so hard in #WebAssembly ? - #WASI has a work around for us, but does it actually work?

I'm not sure - #WAMR #Wasmtime and #WASM3 might all need the new #StackSwitching proposal which was pushed to stage 2 in the #W3C today.

Check out the code samples here - https://withbighair.com/webassembly/2024/08/26/WebAssembly-and-signals.html

WebAssembly and Signal Handling

You can think of signal’s like user space interrupts. Essentially the running application is interrupted, and a signal handler function is invoked. This function is passed some data to describe why it is being interrupted. Once the function is invoked it can process a response to this “signal”. You’ve probably seen this on Linux. Geeks for Geeks has a great description of Signals. They are effectively used to communicate some information to the running process, a common use case is sending a signal to notify a process that is about to be terminated, thus allowing it to clean up resources, closing file handles, etc.

With Big Hair