Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Memory resizing race #129

Closed
jfbastien opened this issue Jul 22, 2016 · 2 comments
Closed

Memory resizing race #129

jfbastien opened this issue Jul 22, 2016 · 2 comments

Comments

@jfbastien
Copy link
Contributor

WebAssembly supports growing the memory's size, and obtaining its current size:
https://github.com/WebAssembly/design/blob/56e617e8144a8b750a1198871eb6d43fad182c21/AstSemantics.md#resizing

  • Many of the spec's algorithms check that accesses are in-range. What happens if one of the algorithms is executing while a resize operation occurs?
  • What happens if memory is resized during an access?

I assume all threads need to be suspended for a resize operation.

@lars-t-hansen
Copy link
Collaborator

Resizing memory is definitely outside of scope for current work, though these are interesting points (also see #59 for other wasm discussion).

@lars-t-hansen
Copy link
Collaborator

The wasm threads spec is now addressing this. I don't think thread suspension during resizing is required there (because a maximum size is always needed and memory will generally be preallocated, or pre-reserved); rather, it seems that a new SAB object is allocated with a larger length field, so operations on the memory will see the old or new SAB. In either case, we'll move the discussion over there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants