Intent to experiment: WebAssembly Threads

194 views
Skip to first unread message

Michael Hablich

unread,
Aug 3, 2018, 4:34:04 AM8/3/18
to blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, laf...@chromium.org, Daniel Clifford

Contact emails (alphasorted)

bi...@chromium.org, dsc...@chromium.org, hab...@chromium.org, tit...@chromium.org


Explainer

Provide low-level building blocks for pthreads-style shared memory: shared memory between threads, atomics and futexes.

New atomic memory operators, including loads/stores annotated with their atomic ordering property, will follow a model compatible with the C++11 memory model (with some differences), similarly to the PNaCl atomic support and the SharedArrayBuffer support in JavaScript. Even when there are data races, WebAssembly will ensure that the nondeterminism remains limited and local.

There is ongoing work to formalize the memory model used by SharedArrayBuffer. This can be used by WebAssembly threads, since both JavaScript and WebAssembly are intended to be able to communicate through SharedArrayBuffer.


More details can be found in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md.


Design doc/Spec

Spec issue: https://github.com/WebAssembly/design/issues/1073

Design doc: https://docs.google.com/document/d/1e0Ye-75niAVqdsCDCxJEMYjAh3OC3ezQIsLc4YcFHj4/edit

Tracking issue: https://bugs.chromium.org/p/chromium/issues/detail?id=754910


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/GMZIcOoFFqw


Goals for experimentation

Real, concurrent threading capabilities with shared memory is something new on the web platform. Thus we are very eager to get early web developer feedback to further finetune the API and ergonomics. In addition we need to better understand the scale web developers might want to use the feature, especially regarding memory consumption and runtime performance. Too, we are interested in early feedback regarding the security considerations.


Experimental timeline

Start: M70 Beta

End: ~M73 Stable (Depends on potential spec changes; Updates expected after the Wasm CG meeting in October)


Any risks when the experiment finishes?

Some partners might depend on the actual implementation to keep on working. They are aware though that the API is experimental and might/will change during the trial.


Ongoing technical constraints

The feature should only be enabled on platforms that fully support Site Isolation: Chrome OS, Windows, Mac, Linux.


Debuggability

No additional support should be needed.


Will this feature be supported on all five Blink platforms supported by Origin Trials (Windows, Mac, Linux, Chrome OS, and Android)?

No, it will only be available on platforms that support Site Isolation: Windows, Mac, Linux, Chrome OS


Link to entry on the feature dashboard

https://www.chromestatus.com/features/5724132452859904 .


Philip Jägenstedt

unread,
Aug 6, 2018, 10:52:33 AM8/6/18
to hab...@chromium.org, blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, laf...@chromium.org, da...@chromium.org
LGTM to experiment.

The latest on Disabling SharedArrayBuffer was it would ship in 68, and https://caniuse.com/#search=SharedArrayBuffer claims the same. However, testing 68 and 69 it doesn't seem like the SharedArrayBuffer constructor is exposed. Does this mean it didn't ship?

More to the point, is the fate of wasm threads tied together with the fate of SAB?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAF2MX8j0nfaSWaAUB_Jc_2TE8fJsJaqASYyAdPeu1HY-1obyrQ%40mail.gmail.com.

Anthony LaForge

unread,
Aug 6, 2018, 11:01:18 AM8/6/18
to foo...@chromium.org, Michael Hablich, blink-dev, bi...@chromium.org, dsc...@chromium.org, tit...@chromium.org, Daniel Clifford
Hi Philip,

SAB was enabled via Finch configuration on 67+ a bit more than a week ago.  Ben (binji@) is (or is in the process of) turning it on by default on trunk.

Kind Regards,

Anthony Laforge
Technical Program Manager
Mountain View, CA

Philip Jägenstedt

unread,
Aug 6, 2018, 11:22:42 AM8/6/18
to laf...@chromium.org, hab...@chromium.org, blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, da...@chromium.org
I see, then even if their fates are connected, SAB is already on track to ship, so my question is moot.

Michael Hablich

unread,
Aug 6, 2018, 11:40:49 AM8/6/18
to Philip Jägenstedt, laf...@chromium.org, blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, Daniel Clifford
Thanks! Please see also the relevant thread on blink-dev: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/wvV42Hxct3g 

Michael Hablich

unread,
Aug 6, 2018, 11:42:06 AM8/6/18
to Philip Jägenstedt, laf...@chromium.org, blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, Daniel Clifford
Hmmm Philip, did you happen to use an Android device for your tests?

Philip Jägenstedt

unread,
Aug 6, 2018, 12:12:44 PM8/6/18
to hab...@chromium.org, laf...@chromium.org, blink-dev, Ben Smith, dsc...@chromium.org, Ben Titzer, da...@chromium.org
No, I was testing on Windows using BrowserStack, mostly because I saw http://web-confluence.appspot.com/ listed it as not supported on Chrome 68 for Windows, and I wanted to compare the same version to see if it might be a bug in confluence.
Reply all
Reply to author
Forward
0 new messages