-
Notifications
You must be signed in to change notification settings - Fork 190
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
add experimenal wasm32-wasi-threads support #274
Conversation
with this and #275, i was able to use more than 1 cpus with the above binary.
|
depending on WebAssembly/wasi-threads#22 we might need to wait for a llvm release with https://reviews.llvm.org/D135898 |
I wouldn't worry too much about using your own fork here; even if wasi-libc doesn't have the TLS PR merged yet this would still be a step in the right direction. We just would want to make sure that any missing pieces like that PR get updated in the submodule before @sunfishcode publishes a new wasi-sdk release, which I hear might be in the next few weeks (?). |
ok. i will drop the "use my fork" commit. instead, i mentioned known issues in the description of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@sunfishcode, you'll have to merge this (I don't have permissions here but I'm a +1 for this PR). @yamt, do we still need to update the wasi-libc commit in the submodule? If so, that can probably be its own PR. |
the latest wasi-libc should be ok. my concern at this point is the coming ABI change from: WebAssembly/wasi-threads#26 |
How stable we consider wasi-sdk? Are we ok at that stage to introduce backward incompatible changes (that can be detected at compile time)? |
Are you asking in general, or specifically regarding this PR? This PR doesn't break any existing thing right, it add a completely new set of target libraries while leaving the rest of the SDK untouched? In the general case, WASI is not yet stable or standardized, and neither is wasi-sdk. Of course, we can and should always do our best to avoid breaking existing code, but we are not at the stage in development of WASI where we rule out such things. Even the core components on which we build wasi-sdk (llvm and musl) make breaking changes from time to time so it not practical to rule out all breaking changes. |
Mainly asked in the context of @yamt 's concerns about ABI changes. Looks like wam32-wasi-threads target is even more experimental than the rest of the wasi-sdk, so I don't think we have to wait for the ABI to be finalized? |
Right, to echo @sbc100, we cannot make too strong guarantees about about the wasi-threads ABI. We have an ABI that is good enough for users to experiment with and we can accompany the prerelease of all of this with some warnings in the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There doesn't seem to be libcxx/libcxxabi builds for |
No, just not enough time to do everything. Are you thinking of contributing something like this in WebAssembly/wasi-libc#392? |
|
pkgsCross.wasi32.llvmPackages: 12 -> 16 * It appears BULK_MEMORY_SOURCES no longer needs to be set to be empty to compile firefox. Without it, the build of wasilibc would fail if enableThreads is true. * Include preliminary support for the experimental threads support in wasilibc which provides pthreads API. If wasilibc is built with support, is exposed via passthru and libcxx / libcxxabi are built with threads support accordingly. See also: - WebAssembly/wasi-sdk#274 - WebAssembly/wasi-sdk#301 - WebAssembly/wasi-sdk#314 wasi-sdk ships it by default, but as a separate variant of libc which would be a hassle for us. Let's just make it optional for now. You can try it out using the following overlay: self: super: { wasilibc = super.wasilibc.override { enableThreads = true; }; } Flags for libc++abi are copied from wasi-sdk.
Hello guys! Does it mean that |
possible blockers / known issues:
tls issue Initialize TLS of the main thread wasi-libc#372thread-spawn
ABI Define types and functions in the proposal's template wasi-threads#26 Experiment the new proposed abi of thread-spawn wasi-libc#385