The GUI rendering thread and JavaScript engine thread in the browser are mutually exclusive, and JavaScript will block UI rendering during execution. Even if the script takes too long to execute, the page becomes unresponsive for a long time and then crashes. It is this mutual exclusion and blocking thread management between the GUI rendering thread and the JavaScript engine thread that makes some front-end developers think that the browser is single-threaded.
Small program dual thread model
The logic layer and the rendering layer are split, each page uses a webview thread, and the JsCore of the logic layer is shared.
This article is reproduced from: http://yoursite.com/2023/08/12/%E4%BB%8E%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%9A%84%E5% 8F%8C%E7%BA%BF%E7%A8%8B%E6%9E%B6%E6%9E%84%E5%B1%95%E5%BC%80/
This site is only for collection, and the copyright belongs to the original author.