Skip to content

Commit 415020e

Browse files
authored
Adjust some documentation for threading intrinsics (#674)
* Synchronize `Binary.md` threading intrinsics In #656 the threading-related intrinsics were revised and updated, but `Binary.md` wasn't updated in the same PR. This commit removes the removed intrinsics (`thread.switch-to` and `thread.yield-to`), reorganizes the list slightly (moves `thread.yield` down), and then renumbers the remaining intrinsics. * Flag `thread.yield` under the async feature gate This matches what wasm-tools/Wasmtime do at least which is `thread.yield` is supported with just the component-model-async feature and doesn't need component-model-threading. IIRC this is due to the fact of this intrinsic existing prior to component-model-threading and it was just renamed later on.
1 parent abfcd1c commit 415020e

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

design/mvp/Binary.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ canon ::= 0x00 0x00 f:<core:funcidx> opts:<opts> ft:<typeidx> => (canon lift
302302
| 0x05 => (canon task.cancel (core func)) 🔀
303303
| 0x0a v:<valtype> i:<u32> => (canon context.get v i (core func)) 🔀
304304
| 0x0b v:<valtype> i:<u32> => (canon context.set v i (core func)) 🔀
305-
| 0x0c cancel?:<cancel?> => (canon thread.yield cancel? (core func)) 🔀
306305
| 0x06 async?:<async?> => (canon subtask.cancel async? (core func)) 🔀
307306
| 0x0d => (canon subtask.drop (core func)) 🔀
308307
| 0x0e t:<typeidx> => (canon stream.new t (core func)) 🔀
@@ -329,10 +328,13 @@ canon ::= 0x00 0x00 f:<core:funcidx> opts:<opts> ft:<typeidx> => (canon lift
329328
| 0x23 => (canon waitable.join (core func)) 🔀
330329
| 0x26 => (canon thread.index (core func)) 🧵
331330
| 0x27 ft:<typeidx> tbl:<core:tableidx> => (canon thread.new-indirect ft tbl (core func)) 🧵
332-
| 0x28 cancel?:<cancel?> => (canon thread.switch-to cancel? (core func)) 🧵
331+
| 0x28 => (canon thread.resume-later (core func)) 🧵
333332
| 0x29 cancel?:<cancel?> => (canon thread.suspend cancel? (core func)) 🧵
334-
| 0x2a => (canon thread.resume-later (core func)) 🧵
335-
| 0x2b cancel?:<cancel?> => (canon thread.yield-to cancel? (core func)) 🧵
333+
| 0x0c cancel?:<cancel?> => (canon thread.yield cancel? (core func)) 🔀
334+
| 0x2a cancel?:<cancel?> => (canon thread.suspend-then-resume cancel? (core func)) 🧵
335+
| 0x2b cancel?:<cancel?> => (canon thread.yield-then-resume cancel? (core func)) 🧵
336+
| 0x2c cancel?:<cancel?> => (canon thread.suspend-then-promote cancel? (core func)) 🧵
337+
| 0x2d cancel?:<cancel?> => (canon thread.yield-then-promote cancel? (core func)) 🧵
336338
| 0x40 shared?:<sh?> ft:<typeidx> => (canon thread.spawn-ref shared? ft (core func)) 🧵②
337339
| 0x41 shared?:<sh?> ft:<typeidx> tbl:<core:tableidx> => (canon thread.spawn-indirect shared? ft tbl (core func)) 🧵②
338340
| 0x42 shared?:<sh?> => (canon thread.available-parallelism shared? (core func)) 🧵②

design/mvp/CanonicalABI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ specified here.
6363
* [`canon thread.new-indirect`](#-canon-threadnew-indirect) 🧵
6464
* [`canon thread.resume-later`](#-canon-threadresume-later) 🧵
6565
* [`canon thread.suspend`](#-canon-threadsuspend) 🧵
66-
* [`canon thread.yield`](#-canon-threadyield) 🧵
66+
* [`canon thread.yield`](#-canon-threadyield) 🔀
6767
* [`canon thread.suspend-then-resume`](#-canon-threadsuspend-then-resume) 🧵
6868
* [`canon thread.yield-then-resume`](#-canon-threadyield-then-resume) 🧵
6969
* [`canon thread.suspend-then-promote`](#-canon-threadsuspend-then-promote) 🧵
@@ -4948,7 +4948,7 @@ cancellation, they can omit `cancellable` so that cancellation is instead
49484948
delivered at a later `cancellable` call.
49494949

49504950

4951-
### 🧵 `canon thread.yield`
4951+
### 🔀 `canon thread.yield`
49524952

49534953
For a canonical definition:
49544954
```wat

0 commit comments

Comments
 (0)