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
Networking: fold websocket and http tokio runtime into one. #31648
Comments
Yes that's correct, it uses a threadpool which will see threads created upfront, instead of spawning one thread for each image that is decoded.
We can use a single runtime for all async task, and a single core resource threadpool for the other non-async bacground work. |
@gterzian Could you add some good-first-issue or E-candidate-for-mentoring label? |
I would like to take this up. |
Hey @tannal what is your status with the issue. Can I join |
@MunishMummadi Yes you can.
You can open another pr to do this part if you are interested in this issue. |
Yes indeed, this part would be good for a new PR @MunishMummadi The idea is to use a single |
Actually, because the image cache runs in the script thread, not in the core resource thread, this is quite complicated and perhaps not a good idea. I withdraw my earlier conclusion. |
* net: use the same tokio runtime in websocket loader #31648 * readability * license
We use two separate Tokio runtimes:
One for HTTP requests:
servo/components/net/http_loader.rs
Line 74 in 525fc58
And another one for Websockets:
servo/components/net/websocket_loader.rs
Line 52 in 525fc58
The rationale is:
servo/components/net/websocket_loader.rs
Lines 48 to 50 in 525fc58
I think it's doubtful that a large amount of websockets could really starve HTTP request, since the whole point of tokio is to run a large amount a tasks onto a single runtime.
We should investigate using one runtime for all networking tasks.
The text was updated successfully, but these errors were encountered: