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 upIntroduce a namespace installer #23934
Conversation
highfive
commented
Aug 8, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Aug 8, 2019
|
I think this is better than the current manual counting of pipeline-namespace that goes on in servo/lib and constellation, it becomes downright useful in the light of for example #23637 Where in order to install a pipeline-namespace in a worker thread, you need to make a blocking ipc call to the constellation, see https://github.com/servo/servo/pull/23637/files#diff-c3210c2a1bf5e1de39588154cd766100R390 The above could be replaced by a simple call in the worker to It would also be useful to install a pipeline-namespace in threads that do not have a direct channel to the constellation, for example the style threadpool(the reason why it might need one is anything requiring creating unique Ids, for example using the shared-ipc router prototyped at #23909, which currently can't work with parallel layout, as the communication with the font-cache occurs from a rayon thread from which it isn't easy to ask the constellation for a pipeline-namespace id). |
|
This isn't going to work in multiprocess, since there is nothing to prevent one process to race ahead of the other if the namespace is just a u32.... I think the only way is tot actually use the constellation as a global lock... |
|
Actually, the last commit might be something the could work. It means we'd still use the constellation to provide the The downside is that the namespace becomes a kind of contended resource for all threads in a process, yet this might not matter in practice. If it were to become a problem, it could be solved by adding some intermediary per-thread namespace, that would be installed using the per-process namespace... This could definitely make it much easier to start using the name-space from a bunch of other threads, without having to orchestrate installing it via the constellation. |
216426d
to
74de1ab
|
@bors-servo try=wpt |
Introduce a process namespace <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #23932 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23934) <!-- Reviewable:end -->
|
|
266e69b
to
e889353
|
@jdm Ok here is the latest variation on the same theme. I think this can be a way to address https://github.com/servo/servo/pull/23637/files#r312133197 generally across all threads. So, still using the constellation as a single source of unique per UA It's better than the previous version since it keeps the actual namespace as a thread-local, and it improves on the current situation since it makes it easy for any thread to install a namespace. It improves on the code at https://github.com/servo/servo/pull/23637/files by removing the need for threads to have their own plumbing to ask the constellation for a namespace. For example, with this any thread in a rayon pool could get it's own namespace without needing to setup a channel with the constellation directly or otherwise being aware of how a namespace is installed. Still building to test if it actually works, I think it should be ok. |
e7daa00
to
55e6ca1
Introduce a namespace installer <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #23932 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23934) <!-- Reviewable:end -->
|
|
|
@jdm this is is ready for review, I haven't squashed those commits since I'm not sure the "batching of Ids" is a good idea, so that commit could still be removed. This is somewhat relevant for the messageport PR, since it could rebase off of this one and simplify the worker code that installs pipeline namespaces. |
|
These changes look fine, but I don't think we need the batch generation. |
| @@ -818,6 +818,18 @@ where | |||
| namespace_id | |||
| } | |||
|
|
|||
| /// Pre-generate a buffer of namespace ids, so content, or other, processes, | |||
| /// do not require to ipc for them initially. | |||
This comment has been minimized.
This comment has been minimized.
jdm
Aug 21, 2019
Member
I imagine that any IPC for pipeline namespace generation will be completely dwarfed by the time it takes for the network request to complete. I don't think this is worth including without data backing it up.
684d897
to
8b98953
8b98953
to
34008a3
|
Ok, rebased as well... |
|
@bors-servo r+ |
|
|
Introduce a namespace installer <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #23932 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23934) <!-- Reviewable:end -->
|
|
gterzian commentedAug 8, 2019
•
edited by SimonSapin
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is