One of the Unity developers raised some important points about WASM's memory model in a github thread. I contributed some additional thoughts here:https://github.com/WebAssembly/design/issues/1397#issuecomment-926119051 …
-
-
Replying to @cmuratori
Regarding circular ring buffer mapping, I think this is not even 100% guaranteed to work on Windows, or did something change in that regard?
1 reply 0 retweets 1 like -
Replying to @molecularmusing @cmuratori
To improve on my wording: it is subject to race conditions as far as I'm aware, but you can usually get what you want by retrying often enough. It's just that the Win32 API doesn't provide a way to map both parts atomically, unless they added an API recently.
1 reply 0 retweets 1 like -
Replying to @molecularmusing
They added it in Windows 10. Here is some example code from refterm:https://github.com/cmuratori/refterm/blob/91e932f011e12c02a6c609ac59570f5c19fe4727/refterm_example_source_buffer.c#L15 …
2 replies 0 retweets 7 likes -
Replying to @cmuratori @molecularmusing
(Note that refterm only uses read-past-end, so it only maps the buffer twice; the read-past-both case would use an additional call, but the idea is the same).
1 reply 0 retweets 2 likes -
Replying to @cmuratori @molecularmusing
A bit of a tangent (maybe). I don't know if this is worthwhile, but does anyone do a VM-backed ring buffer that doesn't double? If you can bound the maximum read size (this seems very possible often?) then you just need to double-map the # max read bytes at the relevant ends.
1 reply 0 retweets 1 like
Don't know. I'm not sure why you would bother not mapping the whole thing, since the address space is cheap on 64-bit? Unless I'm missing your point...
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.