You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: threading.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
3
3
ECMAScript needs real threading where any function can be spawned as a thread to run asynchronously. Most value type data should be accessible across threads with some operations being atomic automatically. The syntax for creating and managing threads should be very minimal and effortless to use.
4
4
5
-
For example, you should be able to define a global ```a:uint32``` and in a thread ```Atomics.add(a, 5)``` it without shuffling it into a typed array.
5
+
For example, you should be able to define a global ```a:uint32``` and in a thread ```Atomics.add(a, 5)``` it without shuffling it into a typed array.
6
6
7
7
```js
8
-
let a:uint32 =0;
8
+
let a:uint32 =0;
9
9
functionA() {
10
-
Atomics.add(a, 5);
10
+
Atomics.add(a, 5);
11
11
}
12
12
asyncfunctionB() {
13
-
A();
14
-
Atomics.add(a, 5);
13
+
A();
14
+
Atomics.add(a, 5);
15
15
}
16
16
// Naive call syntax to show these execute on their own thread and callThread returns a promise.
0 commit comments