-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions on oopsla2019.pdf #1673
Comments
non-shared memory/table/global don't correspond to source-level TLS, which would have to be implemented using a different mechanism (either in shared linear memory, or using a further language extension). Shared functions are prevented from accessing non-shared state entirely (this hopefully also answers your last question).
Now that we have multiple threads, we need to specify instantiation in a way that lets it interleave with execution in other threads. The approach for doing this in the paper isn't the only possible way.
yes, a shared table (which to be clear is not part of the current spec and only a hypothetical sketch by the paper) could only contain shared references (this would be enforced by validation)
Apologies, but I can't work out what you're referring to here.
Note that the |
Just as a high-level point, that paper presents possible extensions to Wasm threads which are currently not part of the language or the initial threads proposal (e.g. shared functions, tables, references, the |
right now, wasi-threads etc are relying on globals (like
the symbol used in the paper, which looks like tex \uplus to me.
ok. how about ⊢ without C on the left-side? |
i'm reading the paper in the context of WebAssembly/wasi-threads#48 |
The compilation scheme assumed by wasi-threads would still work, because that scheme creates a separate Wasm instance for each thread. The
Ah ok. It's been a while since I wrote it, but I'm pretty sure it's intended to mean that the two concurrent (sets of) actions being merged must have non-equal timestamps. If so, I probably should have used a more standard disjoint union symbol. Sorry! Note though that this section of the paper is really deep in the weeds of the formal specification and there isn't too connection to the "language design" question of the threads feature.
That would mean "the object |
well, my question is that, if we want to use the language extension described in the paper
ok.
ok. i haven't noticed "ok" was a english word. :-) |
Yes, you'd need to use a different strategy, unless the core Wasm language was also extended with thread-local globals. See here for some recent discussions on this topic WebAssembly/shared-everything-threads#12. |
ok. |
It is possible to compile pthreads to a hypothetical "Wasm with shared instances", just not using a scheme that puts the stack pointer in a global, without even further language extensions such as "thread-local global". At the time the paper was written, the idea was just that shared functions/instances are the immediate next generalisation after shared memories (i.e. the current threads proposal), so it made sense to write about them. If we did add thread-local globals, that would still be building on top of shared functions/instances - the paper just didn't go that far. |
The questions here appear to be answered; please file new issues if there are further questions. |
i'm trying to understand https://github.com/WebAssembly/spec/blob/main/papers/oopsla2019.pdf
and have some questions.
are "local" memory/global/table expected to work as
thread-local storage? that is, do they always involve
TLS overhead even when threads are not used at all?
(at least for a naive implementation)
why is the "instantiate" opcode included in this same paper?
to me, it looks like a very separate topic from the rest of the doc.
does a value returned by ref.null have a shared/local distinction?
Fig 2.
reference types are
and table types are
does it mean
?
Fig 11.
what's the uplus operator?
is it same as oplus in
https://webassembly.github.io/spec/core/syntax/conventions.html#notation-compose
?
what's E[]?
Fig 21.
what's the turnstile operator (⊢) and colon (:) used here?
eg.
⊢ord:sh
⊢ft:ok
how does eg.
parse?
p8 says
it made me think shared functions could access (its own copy of) local instance objects.
otoh, p29 says
it made me think shared functions couldn't access any local instance objects.
i'm confused what can access what.
The text was updated successfully, but these errors were encountered: