@@ -78,12 +78,11 @@ these languages' concurrency features are already bound (making the Component
78
78
Model "just another OS" from the language toolchains' perspective).
79
79
80
80
Moreover, this async ABI does not require components to use preemptive
81
- multi-threading ([ ` thread.spawn ` ] ) in order to achieve concurrency. Instead,
82
- concurrency can be achieved by cooperatively switching between different
83
- logical tasks running on a single thread. This switching may require the use of
84
- [ fibers] or a [ CPS transform] , but may also be avoided entirely when a
85
- component's producer toolchain is engineered to always return to an
86
- [ event loop] .
81
+ multi-threading ([ ` thread.spawn* ` ] ) in order to achieve concurrency. Instead,
82
+ concurrency can be achieved by cooperatively switching between different logical
83
+ tasks running on a single thread. This switching may require the use of [ fibers]
84
+ or a [ CPS transform] , but may also be avoided entirely when a component's
85
+ producer toolchain is engineered to always return to an [ event loop] .
87
86
88
87
To avoid partitioning the world along sync/async lines as mentioned in the
89
88
Goals section, the Component Model allows * every* component-level function type
@@ -630,11 +629,11 @@ these values is defined by the Canonical ABI.
630
629
631
630
## Interaction with multi-threading
632
631
633
- For now, the integration between multi-threading (via [ ` thread.spawn ` ] ) and
634
- native async is limited. In particular, because all [ lift and lower
635
- definitions ] produce non-` shared ` functions, any threads spawned by a component
636
- via ` thread.spawn ` will not be able to directly call imports (synchronously
637
- * or * asynchronously) and will thus have to use Core WebAssembly ` atomics.* `
632
+ For now, the integration between multi-threading (via [ ` thread.spawn* ` ] ) and
633
+ native async is limited. In particular, because all [ lift and lower definitions ]
634
+ produce non-` shared ` functions, any threads spawned by a component via
635
+ ` thread.spawn* ` will not be able to directly call imports (synchronously * or *
636
+ asynchronously) and will thus have to use Core WebAssembly ` atomics.* `
638
637
instructions to switch back to a non-` shared ` function running on the "main"
639
638
thread (i.e., whichever thread was used to call the component's exports).
640
639
@@ -651,8 +650,8 @@ composition story described above could naturally be extended to a
651
650
sync+async+shared composition story, continuing to avoid the "what color is
652
651
your function" problem (where ` shared ` is the [ color] ).
653
652
654
- Even without any use of ` thread.new ` , native async provides an opportunity to
655
- achieve some automatic parallelism "for free". In particular, due to the
653
+ Even without any use of [ ` thread.spawn* ` ] , native async provides an opportunity
654
+ to achieve some automatic parallelism "for free". In particular, due to the
656
655
shared-nothing nature of components, each component instance could be given a
657
656
separate thread on which to interleave all tasks executing in that instance.
658
657
Thus, in a cross-component call from ` C1 ` to ` C2 ` , ` C2 ` 's task can run in a
@@ -720,7 +719,7 @@ comes after:
720
719
[ `yield` ] : Explainer.md#-yield
721
720
[ `waitable-set.wait` ] : Explainer.md#-waitable-setwait
722
721
[ `waitable-set.poll` ] : Explainer.md#-waitable-setpoll
723
- [ `thread.spawn` ] : Explainer.md#-threadspawn
722
+ [ `thread.spawn* ` ] : Explainer.md#-threadspawnref
724
723
[ ESM-integration ] : Explainer.md#ESM-integration
725
724
726
725
[ Canonical ABI Explainer ] : CanonicalABI.md
0 commit comments