foo.com and bar.com are both running Rust/wasm32 code we control
this is all running in latest Chrome
Question: Is it possible to setup a shared memory, between foo.com and bar.com, where we have an atomic int64 in the shared memory ?
XY problem: I have Rust/wasm32 code running in different iframes; and I want a simple way, without going into vector clocks, of defining a total order for events that happen in different iframes.
I'd prefer to use shared memory instead of paying the price of postMessage/onMessage constantly.
I don't believe there's any way to directly share memory between multiple iframes even if they have the same origin.
You can use a SharedWorker in the same origin case to have a memory region that is accessible from multiple iframes, but you still have to communicate with the worker via messages from the iframes.