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 ProcessNamespace? #23932
Closed
Introduce ProcessNamespace? #23932
Labels
Comments
|
I've tried, it felt like a good idea for a few hours, then I realized a process could just race ahead of another, and the only way to make sure each process is creating unique IDs is literally by using the constellation as a global lock and the single source of increasing namespace ids... |
|
However, this might still work if we were to make the |
bors-servo
added a commit
that referenced
this issue
Aug 9, 2019
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 -->
bors-servo
added a commit
that referenced
this issue
Aug 13, 2019
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 -->
bors-servo
added a commit
that referenced
this issue
Aug 14, 2019
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 -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In both #23637 and #23909 I find myself installing
PipelineNamspacein various threads that currently do not have one, mainly as a way to use various new types ofIdthat aren'tPipelineId, likeMessagePortIdorIpcRouterId. Those need to follow a similar model since they can end-up crossing process boundaries(message-port), or need to be unique per process.It can be quite hard to install a pipeline namespace for some threads, especially if those threads do not have a direct channel to the constellation. For example the threadpool used by layout, from within which calls are made to the font-cache(which I tried to refactor to use this prototype
SharedIpcRouter).For other threads, like dedicated workers and layout, it's merely an inconvenient blocking ipc call to the constellation.
So, perhaps we could have a
ProcessNamespacebe a lazy static, put a mutex around it(or make it an atomic), then each thread upon initialization could grab it, install a thread-localPipelineNamespacebased on something likeProcessNamespace::new_pipeline_id(), which could be an easy way for a thread to install aPipelineNamespacewithout having to communicate with the constellation.And the
ProcessNamespaceis something the constellation could seed, like is currently done withPipelineNamespace, when the process is created.