Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all agent allocation imperative #5411

Merged
merged 3 commits into from
Mar 31, 2020

Conversation

domenic
Copy link
Member

@domenic domenic commented Mar 27, 2020

Closes #5210.

Closes #4339 by removing the explicit phrasing of a parallel execution
environment, instead relying on the agent infrastructure.

Closes #4988 by reintroducing a definition for "similar-origin window
agent", separate from its creation algorithm. Like the definition of all
agent types, it is now informal, just stating what globals are contained
in the agent.

Relocates the site-related definitions to the "Origin" section of the
spec, adjacent to the "schemelessly same site" and "same site"
definitions.

Exposes some of the higher-level concepts here to the dev edition.


This will require changes to the service worker and worklet specs to use the new concepts; stay tuned for some PRs there.

I could have factored out the movement of the site stuff into a separate commit; let me know if that'd be preferable.


/browsers.html ( diff )
/browsing-the-web.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/origin.html ( diff )
/webappapis.html ( diff )
/window-object.html ( diff )
/workers.html ( diff )

@domenic domenic added clarification Standard could be clearer topic: agent The interaction with JavaScript's agent and agent cluster concepts labels Mar 27, 2020
@domenic domenic requested a review from annevk March 27, 2020 19:51
domenic added a commit to domenic/ServiceWorker that referenced this pull request Mar 27, 2020
@domenic domenic force-pushed the imperative-agent-cluster-allocation branch from 62f035c to 6c11764 Compare March 27, 2020 20:13
domenic added a commit to domenic/css-houdini-drafts that referenced this pull request Mar 27, 2020
domenic added a commit that referenced this pull request Mar 30, 2020
This adds a specific definition for "an agent's event loop", as opposed
to "event loop" generally, and uses it where appropriate. In a few
cases, this involves moving from "object's event loop" to "object's
relevant agent's event loop".

Note that for worker agents, event loop creation and association with
the agent is explicit. For window agents there is no corresponding text.
This can be settled as part of #5411.
@domenic
Copy link
Member Author

domenic commented Mar 30, 2020

#5416 should land before this, and then after it does, this PR should be updated to explicitly create event loops and associate them with agents at agent creation time.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great to me. And we got all the way here without help from upstream. Hopefully this can help inform that discussion a bit when it eventually comes.

source Show resolved Hide resolved
source Outdated Show resolved Hide resolved

<div w-nodev>

<p>To <dfn>create an agent</dfn>, given a boolean <var>canBlock</var>:</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but I do wonder about the relationship with agent clusters. I guess we'll just wait for JavaScript to organize that?

source Show resolved Hide resolved
domenic added a commit that referenced this pull request Mar 31, 2020
This adds a specific definition for "an agent's event loop", as opposed
to "event loop" generally, and uses it where appropriate. In a few
cases, this involves moving from "object's event loop" to "object's
relevant agent's event loop".

Note that for worker agents, event loop creation and association with
the agent is explicit. For window agents there is no corresponding text.
This can be settled as part of #5411.
domenic added a commit that referenced this pull request Mar 31, 2020
This adds a specific definition for "an agent's event loop", as opposed
to "event loop" generally, and uses it where appropriate. In a few
cases, this involves moving from "object's event loop" to "object's
relevant agent's event loop".

Note that for worker agents, event loop creation and association with
the agent is explicit. For window agents there is no corresponding text.
This can be settled as part of #5411.
Closes #5210.

Closes #4339 by removing the explicit phrasing of a parallel execution
environment, instead relying on the agent infrastructure.

Closes #4988 by reintroducing a definition for "similar-origin window
agent", separate from its creation algorithm. Like the definition of all
agent types, it is now informal, just stating what globals are contained
in the agent.

Relocates the site-related definitions to the "Origin" section of the
spec, adjacent to the "schemelessly same site" and "same site"
definitions.

Exposes some of the higher-level concepts here to the dev edition.
@domenic domenic force-pushed the imperative-agent-cluster-allocation branch from 3924e32 to fdebd6b Compare March 31, 2020 16:34
@domenic
Copy link
Member Author

domenic commented Mar 31, 2020

Ready for re-review. Thanks for the suggestions; your version of obtain a worker/worklet agent is much better.

domenic added a commit to domenic/css-houdini-drafts that referenced this pull request Mar 31, 2020
Follows whatwg/html#5411. Also includes a top-level origin, introduced in whatwg/html#4966.
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! (One question, but okay either way I think.)

agent">obtaining a dedicated/shared worker agent</span> given <var>outside settings</var> and
<var>is shared</var>. Run the rest of these steps in that agent.</p>

<p id="worker-processing-model-top">For the purposes of timing APIs, this is the <dfn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move this id inward?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really figure out what this is used for; neither the HTML spec itself, nor https://w3c.github.io/hr-time/, references it. So I guessed that it might be best used for something that wanted to link to "when we enter a parallel thread", which now aligns with this step. Otherwise one would just link to "run a worker" directly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@domenic domenic merged commit 12a2a56 into master Mar 31, 2020
@domenic domenic deleted the imperative-agent-cluster-allocation branch March 31, 2020 17:10
bfgeek pushed a commit to w3c/css-houdini-drafts that referenced this pull request Apr 6, 2020
Follows whatwg/html#5411. Also includes a top-level origin, introduced in whatwg/html#4966.
jakearchibald added a commit to w3c/ServiceWorker that referenced this pull request Apr 7, 2020
* Update agent and realm allocation

Follows whatwg/html#5411.

* Update docs/index.bs

* Update docs/index.bs

* agent/event loop

* Event loop and other ESO fixes

Co-authored-by: Jake Archibald <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: agent The interaction with JavaScript's agent and agent cluster concepts
2 participants