Repository navigation
Add Guest Task Affinity - #739
Conversation
Add a section describing that guest language async tasks must maintain an affinity with Component Model tasks.
| components. Consequently, when a guest language has its own async/await | ||
| constructs, multiple guest tasks spawned by different Component Model tasks may | ||
| be running within a single instance. In these situations, guest-language | ||
| runtimes are required to maintain *guest task affinity*: a runtime must ensure |
There was a problem hiding this comment.
As we discussed in the SIG-Component-Model meeting, I'd prefer to use "should" rather than "must" here, both because it's something that's impossible for a host runtime to verify or enforce, and because most applications (i.e. those that don't involve tasks communicating with each other via e.g. global channels) will have correct attribution regardless. And among those apps which do include inter-task communication, the notion of "correct attribution" gets a lot fuzzier anyway (e.g. did task A send a URL to task B so the latter could make a request on the former's behalf? In that case, attributing the request to A seems reasonable even if B is the one that made it).
To be clear, I think updating guest toolchains to adhere to this is a good thing and we should do it; I just don't think it needs to be mandatory.
There was a problem hiding this comment.
I've modified it to use "should" everywhere.
lukewagner
left a comment
There was a problem hiding this comment.
Looks good to me too; thanks!
Co-authored-by: Luke Wagner <mail@lukewagner.name>
Add a section describing that guest language async tasks must maintain an affinity with Component Model tasks.