Comments (5)
Building the upstream libdispatch code is currently blocked by #658.
from swift.
Basically yes. I think the availability of SharedArrayBuffer
in all browsers would allow us to emulate threads with web workers, but I wouldn't be surprised if it doesn't become widely available earlier than WebAssembly threads. Then what's the point of doing emulation for a single browser (Chrome in this case)?
I'm following the threads proposal and surely it's best to start thinking about it now. But another reasoning here is that we have very limited resources on the toolchain side of things. We need to carefully pick high priority things and complete those quickly, primarily to drive the SwiftWasm ecosystem adoption. I personally wouldn't have the capacity to look into both the web worker emulation and the true threads support. If you're willing to drive implementation efforts for either of those, that would very greatly appreciated 🙏
By the way, with regards to capitalization it's "Wasm" or "wasm", but never "WASM", because it is not an acronym. 🙂 We also follow the capitalization convention established by RustWasm.
from swift.
Is there a way to build libdispatch on top of the Wasm Thread or web worker?
from swift.
The big problem here is that WebAssembly threads are available only in a few browsers such as Chrome, and only under a flag. The threads proposal is still in flux, so no matter what we do now, would probably need to change later.
And with web workers, you still need some syncronization primitives, which requires shared memory between WebAssembly modules. The only way to do that currently is with SharedArrayBuffer
which is slow as it requires bridging to JavaScript, and is also disabled in most browsers:
Note that SharedArrayBuffer was disabled by default in all major browsers on 5 January, 2018 in response to Spectre. Chrome re-enabled it in v67 on platforms where its site-isolation feature is enabled to protect against Spectre-style vulnerabilities.
from swift.
Thanks for the answer. So the only hope is to wait for WASM Thread
from swift.
Related Issues (20)
- Fatal error during compilation (Functions with 'no-prototype' attribute must take varargs) HOT 2
- The test executable fails to run due to call stack exhausted (swift-wasm-DEVELOPMENT-SNAPSHOT-2024-03-22-a) HOT 5
- XCTest requires access to host file system HOT 2
- XMLParser use requires shim to include libxml2.a HOT 3
- Cannot install swift-wasm-DEVELOPMENT-SNAPSHOT-2024-03-30-a-ubuntu20.04_aarch64.artifactbundle.zip HOT 3
- Roadmap: WASI Preview2 Support
- Support Swift SDK in vscode-swift
- Cannot import Foundation when using a host platform independent SDK HOT 6
- undefined symbols (RegexParser) HOT 2
- Thread and RunLoopMode.common in not available on WASM HOT 1
- SwiftWasm 6.0 release
- wasm-ld: error: swiftrt.o: undefined symbol: swift_addNewDSOImage HOT 2
- Overwriting a file with `Data.write(to:)` causes an error
- Embedded Wasm Build Is Needlessly Slow HOT 1
- Repair swift-corelibs-foundation build
- Bundle swift-testing in toolchain HOT 1
- Global Constant Strings Unavailable with Reactor Model HOT 9
- Migrate integration tests to use Swift SDK instead of assuming toolchain style distribution
- Ship non-threads and threads SDKs as a single SDK
- Code Coverage Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift.