Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Pending Publication Date: 2022-01-04
BEIJING BYTEDANCE NETWORK TECH CO LTD
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Embodiments of the present invention provide a thread processing method and device, and a computer-readable storage medium for electronic equipment, aiming to solve the technical problem of poor user experience caused by thread suspension failure in related technologies

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Thread processing method and device, electronic equipment and computer readable storage medium
  • Thread processing method and device, electronic equipment and computer readable storage medium
  • Thread processing method and device, electronic equipment and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a thread processing method and device, electronic equipment and a computer readable storage medium. The method comprises: obtaining a suspension request for a thread in a process; starting a timer based on the suspension request; when the timer is overtime and the thread is still not successfully suspended, identifying a suspended time limit identifier of the thread, wherein the suspended time limit identifier is determined based on a real-time process state of a main body to which the thread belongs and / or a specified execution process occurring in the main body to which the thread belongs; under the condition that the suspension time limit identifier of the thread is the first identifier, restarting the timer; and under the condition that the suspension time limit identifier of the thread is a second identifier, determining that the thread suspension fails, the first identifier being used for indicating restart timing, and the second identifier being used for indicating non-restart timing. Through the technical scheme of the invention, the probability of occurrence of process crash caused by failure of thread suspension is reduced, so that the phenomenon of application crash is reduced, and the use experience of a user on the application is improved.

Description

【Technical field】 [0001] The present invention relates to the field of computer technology, in particular to a thread processing method and device, electronic equipment, and a computer-readable storage medium. 【Background technique】 [0002] In an electronic device, multiple threads can run concurrently in its process, and each thread, as the smallest unit of operation scheduling, can belong to different applications and execute different tasks in parallel. During the working process of the electronic device, the thread may be set to a "non-executable" state to suspend the running of the thread. This behavior is the suspension of the thread. [0003] However, threads are suspended for a limited amount of time. The timing starts from initiating thread suspension, and once the time limit is exceeded, the thread cannot be suspended, that is, the thread suspension times out. At this time, it can be determined that the thread suspension has failed. Failure to suspend the thread...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/445G06F11/14
CPCG06F9/44594G06F11/1438
Inventor 韩立
Owner BEIJING BYTEDANCE NETWORK TECH CO LTD