@@ -78,12 +78,11 @@ these languages' concurrency features are already bound (making the Component
7878Model "just another OS" from the language toolchains' perspective).
7979
8080Moreover, 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] .
8786
8887To avoid partitioning the world along sync/async lines as mentioned in the
8988Goals section, the Component Model allows * every* component-level function type
@@ -672,11 +671,11 @@ by declarative instantiation and `start` above.
672671
673672## Interaction with multi-threading
674673
675- For now, the integration between multi-threading (via [ ` thread.spawn ` ] ) and
676- native async is limited. In particular, because all [ lift and lower
677- definitions ] produce non-` shared ` functions, any threads spawned by a component
678- via ` thread.spawn ` will not be able to directly call imports (synchronously
679- * or * asynchronously) and will thus have to use Core WebAssembly ` atomics.* `
674+ For now, the integration between multi-threading (via [ ` thread.spawn* ` ] ) and
675+ native async is limited. In particular, because all [ lift and lower definitions ]
676+ produce non-` shared ` functions, any threads spawned by a component via
677+ ` thread.spawn* ` will not be able to directly call imports (synchronously * or *
678+ asynchronously) and will thus have to use Core WebAssembly ` atomics.* `
680679instructions to switch back to a non-` shared ` function running on the "main"
681680thread (i.e., whichever thread was used to call the component's exports).
682681
@@ -693,8 +692,8 @@ composition story described above could naturally be extended to a
693692sync+async+shared composition story, continuing to avoid the "what color is
694693your function" problem (where ` shared ` is the [ color] ).
695694
696- Even without any use of ` thread.new ` , native async provides an opportunity to
697- achieve some automatic parallelism "for free". In particular, due to the
695+ Even without any use of [ ` thread.spawn* ` ] , native async provides an opportunity
696+ to achieve some automatic parallelism "for free". In particular, due to the
698697shared-nothing nature of components, each component instance could be given a
699698separate thread on which to interleave all tasks executing in that instance.
700699Thus, in a cross-component call from ` C1 ` to ` C2 ` , ` C2 ` 's task can run in a
@@ -750,7 +749,7 @@ comes after:
750749[ `yield` ] : Explainer.md#-yield
751750[ `waitable-set.wait` ] : Explainer.md#-waitable-setwait
752751[ `waitable-set.poll` ] : Explainer.md#-waitable-setpoll
753- [ `thread.spawn` ] : Explainer.md#-threadspawn
752+ [ `thread.spawn* ` ] : Explainer.md#-threadspawnref
754753[ ESM-integration ] : Explainer.md#ESM-integration
755754
756755[ Canonical ABI Explainer ] : CanonicalABI.md
0 commit comments