Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement formal concepts of agents, and agents cluster - spec changes #23306
Comments
|
Here is one more potential reason to track the agent/agent-clusters concept at the level of the constellation: whatwg/html#4339 At least as I understand it, shared workers could live in their own agent clusters, and be "shared" with agents inside other clusters(processes). Having the constellation retain a global view of clusters could facilitate such a setup(versus our current approach which is to keep workers "hidden" inside a script-thread and potentially the process it is running in). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The HTML spec introduced two new concepts to integrate with concepts from Javascript, those are
Agents are basically independent threads of executions, pretty close to what we have as a
ScriptThread, although the spec defines specific agent types:The spec then maps event-loop types to agents, in the form of Window event-loops(used by Similar Origin Window Agent, and possibly shared across those), and Worker and Worklet event-loops, used by their respective type of agents.
===
I don't really have specific actionable things to suggest, other than just being aware of those changes.
It seems to me the formal concepts of "Agent clusters" could influence our approach to process isolation. @asajeffrey
I also have a vague feeling we should probably add those concepts to the constellation, to track the various "agents", as well as their event-loops and the "clusters" to which they belong.
For example, the constellation currently keeps track of
EventLoop, and anEventLoopis essentially the constellation view of aScriptThread, which would map to a Similar Origin Window Agent in the spec.I don't think the constellation is aware of worker threads/event-loops, which are spawned on a "ad-hoc" basis from withhin a
ScriptThread, see for exampleservo/components/script/dom/dedicatedworkerglobalscope.rs
Line 272 in b73956c
It might be a good idea to make our current
EventLoopan enum, and perhaps rename it toAgentand make the constellation track all such "agents", including those for workers, and start grouping them by "agent clusters".This wouldn't fit with how
EventLoopare shared between pipelines(since we wouldn't want a window sharing an event-loop with a worker), but that's something that probably should change as well based on another change to the spec, see #23307