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

WebGPU IdentityHub could create the same ID when we have multiple threads #25725

Closed
imiklos opened this issue Feb 11, 2020 · 0 comments
Closed

WebGPU IdentityHub could create the same ID when we have multiple threads #25725

imiklos opened this issue Feb 11, 2020 · 0 comments

Comments

@imiklos
Copy link
Contributor

@imiklos imiklos commented Feb 11, 2020

When we create an ID, we could have multiple threads that end up creating the same ID independently. Possible we need to share a single gpu_id_hub between all threads using Arc & Mutex

@kunalmohan kunalmohan added this to To do in WebGPU MVP May 11, 2020
bors-servo added a commit that referenced this issue May 14, 2020
Share single gpu_id_hub among all threads in a process

<!-- Please describe your changes on the following line: -->
An id_hub for a content process is created when a new script thread is created. This is then cloned whenever a new globalscope object is created. The only exception being service workers because they exist in separate processes, for them a new hub is created.
r?@jdm @kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25725 (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. -->
@kunalmohan kunalmohan moved this from To do to In progress in WebGPU MVP May 14, 2020
bors-servo added a commit that referenced this issue May 14, 2020
Share single gpu_id_hub among all threads in a process

<!-- Please describe your changes on the following line: -->
An id_hub for a content process is created when a new script thread is created. This is then cloned whenever a new globalscope object is created. The only exception being service workers because they exist in separate processes, for them a new hub is created.
r?@jdm @kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25725 (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. -->
WebGPU MVP automation moved this from In progress to Done May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
WebGPU MVP
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.