Thread processing method and device, electronic equipment and computer readable storage medium
A thread processing and thread technology, applied in the computer field, can solve problems such as thread hangup failure and poor user experience, and achieve the effects of improving success rate, increasing available time, and reducing crashes
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0045] figure 1 A flowchart of a thread processing method according to an embodiment of the present invention is shown.
[0046] like figure 1 As shown, the process of the thread processing method according to an embodiment of the present invention includes:
[0047] Step 102, obtaining a suspension request for a thread in the process.
[0048] Multiple threads can run concurrently in a process, and each thread can belong to a different application and perform its own corresponding tasks. At this point, a suspend request to any thread may be received, and the suspend request is used to request that the thread be set to a non-executable state, so as to suspend the running of the thread.
[0049] Step 104, start a timer based on the suspension request.
[0050] The thread itself has a corresponding maximum suspension duration, which is the maximum duration that the thread can successfully suspend. Once the real-time suspension duration of the thread exceeds the maximum suspe...
Embodiment 2
[0071] On the basis of Embodiment 1, the duration of the timer can also be extended during the initial setting process. That is to say, first extend the timing duration of the timer, and then use the extended timing duration to determine whether the thread has not been successfully suspended when the timer expires.
[0072] Extending the timing duration of the timer has provided more consumable time and chances of suspending the thread for suspending the thread. In the case of using the extended timing duration, if the thread has not been successfully suspended when the timer expires, it may Restart the timer at least once to extend the thread suspension time again, which can further provide more consumable time and suspend success chances for the thread suspension, and provide double guarantees for the successful suspension of the thread.
[0073] In a possible design, a manner of extending the timing duration of the timer is to extend the timing duration of the timer to a sp...
Embodiment 3
[0086] On the basis of Embodiment 1 and Embodiment 2, the suspension time limit flag of the thread can be flexibly set. Among them, the updated real-time process status of the subject to which the thread belongs can be obtained, so as to determine the Said suspension time limit identifier for threads.
[0087] In a possible design, the second function is stored in a body such as a virtual machine or a terminal, where the second function of the virtual machine is stored in a dynamic library of the virtual machine. Based on this, the manner of acquiring the updated real-time process state of the subject to which the thread belongs includes: replacing the second function with the second hook function during the initial configuration process. Wherein, the second function is used to update the real-time process state of the main body to which the thread belongs, and the second hook function is used to obtain the updated real-time process state of the main body to which the thread b...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


