Browser Hang Mitigation via Thread Segmentation and Feedback
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Web browsers often face compatibility issues with newer versions, leading to hang conditions when executing third-party code, which can freeze tabs or windows, forcing users to shut down and relaunch the browser.
Innovation Solution
Implementing a system where a first thread monitors a second thread for hang conditions by issuing a hang resistance message and entering a mitigation state if no response is received within a predetermined time, allowing the browser to continue functioning and enabling user interaction despite the hang condition.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the browser executes third-party code in a tab or window, then the web application functionality is provided, but the tab or window may hang or freeze, forcing the user to shut down and relaunch the browser
Solution Approach 1:
The browser is divided into multiple independent threads: a first thread that processes user input and navigation, and a second thread that executes third-party code. This segmentation isolates the unstable third-party code execution to a separate thread, preventing it from causing the entire browser to hang while maintaining web application functionality.
Solution Approach 2:
A message queue system acts as an intermediary between the first thread and the second thread. The first thread can send messages to the second thread for processing, and the second thread processes messages from the queue. This intermediary mechanism allows the browser to maintain responsiveness in the first thread while the second thread handles potentially hanging third-party code execution.
2Adaptability or versatility
If the browser runs older browser versions to ensure compatibility with legacy web applications, then compatibility is maintained, but the browser becomes more prone to errors and hang conditions
Solution Approach 1:
The browser architecture segments legacy web application execution into a dedicated second thread that handles third-party code, while the first thread maintains modern browser functionality. This allows the system to run legacy applications without requiring the entire browser to operate in an older, less reliable mode.
Solution Approach 2:
The system changes the operational parameters of thread execution by implementing asynchronous message processing and timeout detection. When the second thread fails to respond within a predetermined time period, the system detects the hang condition and transitions to a mitigation state, allowing the first thread to continue operating with modified parameters that maintain browser responsiveness.
3Reliability
If the browser implements comprehensive monitoring of thread execution to detect hang conditions, then hang detection capability is improved, but the system complexity increases
Solution Approach 1:
The first thread implements feedback monitoring by sending messages to the second thread and waiting for responses within a predetermined time period. This feedback mechanism provides simple yet effective hang detection without requiring complex monitoring infrastructure, as the absence of a timely response directly indicates a hang condition.
Solution Approach 2:
The second thread monitors its own execution state by processing messages from its queue and responding to the first thread. This self-service approach allows the thread to detect its own hang conditions without requiring external monitoring mechanisms, reducing overall system complexity while maintaining reliable detection.
Data Source
AI summary
Methods, systems, and computer program products are provided for detecting a browser hang condition and causing the browser to enter into a mitigation state. For instance, a window or tab of the browser executes via a first thread of the browser, and third-party code executes via a second thread of the browser. The first thread issues a hang resistance message to the second thread and waits for a response from the second thread. The second thread processes the hang resistance message after processing all other messages in its queue. Thus, if the first thread receives the response, the first thread determines that the second thread has not entered into a hang condition. However, if the first thread does not receive the response, the first thread determines that the second thread has entered into a hang condition and subsequently causes the browser to enter the mitigation state.


