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

Thread management and control system

A technology for managing and controlling systems and threads. It is applied in the field of thread management and can solve problems such as inability to recycle activity instances, applications not responding to prompts, and device usage being stuck.

Pending Publication Date: 2022-02-08
小马国炬(玉溪)科技有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] In the Android system, in addition to immediate response events such as UI display and interaction visible to users, there are relatively long-time-consuming scenarios such as algorithm processing, network requests, file downloads, and data IO. These relatively long-term scenarios usually cannot Do it directly in MainThread, otherwise it will cause the device to freeze seriously and cause the application to pop up a prompt that does not respond
[0003] In the Android system, the usual time-consuming operations (algorithm processing, network requests, file downloads, data IO, etc.) will create a new ChildThread to execute, and then display the results to the user after execution; but in the Android system, ChildThread It is not allowed to directly update the page UI information and perform user interaction, then use the system class handler provided by the Android system to interact
In this process, the corresponding handler instance of the handler will be referenced by the application MainThread after being created, and the Android basic interface unit activity will be referenced by the handler. The life cycle of the MainThread is accompanied by the survival of the entire application, which will cause an interface activity to exit. , due to the existence of the above reference chain, the activity instance cannot be recycled, and the activity usually references more resources. If the activity cannot be effectively recycled, it will cause a large amount of memory leaks

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 management and control system
  • Thread management and control system
  • Thread management and control system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0025] Thread (thread) is the smallest unit that the operating system can perform operation scheduling; MainThread (main thread) is the basic unit of application running in the Android system; ChildThread (sub-thread) sub-threads are mostly used for algorithm processing, network requests, file downloads, and data IO and other asynchronous time-consuming scenarios; handler (asynchronous message processor) is mainly used for processing asynchronous messages; acti...

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 discloses a thread management and control system, which comprises a class definition module used for respectively defining classes for realizing sub-thread functions and reference control; the task execution module is used for generating a handler object corresponding to the current task, generating a sub-thread corresponding to the current task based on the class for realizing the sub-thread function, and realizing the execution of the current task through the interaction of the handler object and the sub-thread; and the reference control module is used for generating a reference control object corresponding to the current task based on the class for realizing the reference control, and binding the life cycle of the corresponding activity in the execution process of the current task by utilizing the reference control object so as to automatically cut off the reference to the activity after the life cycle of the corresponding activity is ended. According to the method and the device, the corresponding recovery can be realized in time after the activity exits in the task execution process, and the occurrence of memory leakage is avoided.

Description

technical field [0001] The invention relates to the technical field of thread management, and more specifically, to a thread management and control system. Background technique [0002] In the Android system, in addition to immediate response events such as user-visible UI display and interaction, there are relatively long-time-consuming scenarios such as algorithm processing, network requests, file downloads, and data IO. These relatively long-term scenarios usually cannot Do it directly in MainThread, otherwise it will cause the device to freeze severely and cause the application to pop up a notification that it has not responded. [0003] In the Android system, the usual time-consuming operations (algorithm processing, network requests, file downloads, data IO, etc.) will create a new ChildThread to execute, and then display the results to the user after execution; but in the Android system, ChildThread It is not allowed to directly update the page UI information and per...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/50
CPCG06F9/5016G06F9/5022G06F9/5027G06F2209/5018
Inventor 黄明远马黎明
Owner 小马国炬(玉溪)科技有限公司