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 upCheck if the script thread outlives web worker threads #11512
Comments
|
Hmm, maybe. I know too little about the lifetime of script threads vs workers to judge this. Ideally we'd have some script thread and JSRuntime whose lifetime is guaranteed to equal the process' lifetime, and make that be the parent for all other JSRuntimes in the process. Might be worth it to create a runtime not used for any actual content just for that. With low heap size and a compacting GC run after its creation, perhaps. |
|
For something like browser.html a long-lived runtime for the root page is easy and sensible. For non-browser.html it's much harder to conceptualize what a long-lived script thread would do. A small per-content process runtime that is unrelated to any script thread and usable as the parent for all other runtimes makes the most sense to me. |
|
I've started to write something in rust-mozjs to go that way. |
Bump rust-mozjs for the safe Runtime::new (fixes #11512) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11520) <!-- Reviewable:end -->
This may be a problem now that we use the parent runtime support.
CC @tschneidereit @nox @jdm