CN107247630A - Thread detection method, terminal and computer-readable recording medium - Google Patents
Thread detection method, terminal and computer-readable recording medium Download PDFInfo
- Publication number
- CN107247630A CN107247630A CN201710421788.7A CN201710421788A CN107247630A CN 107247630 A CN107247630 A CN 107247630A CN 201710421788 A CN201710421788 A CN 201710421788A CN 107247630 A CN107247630 A CN 107247630A
- Authority
- CN
- China
- Prior art keywords
- thread
- deadlock
- nucleus module
- module
- default
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/524—Deadlock detection or avoidance
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of thread detection method, this method comprises the following steps:In task thread dispatching nucleus module, the nucleus module is locked by presetting public lock;Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine whether the nucleus module can use;If failing to get the default public lock in default time-out time, it is determined that the nucleus module is unavailable, and determines that the mission thread and nucleus module there occurs deadlock.The invention also discloses a kind of thread detection terminal and computer-readable recording medium.The present invention detects that its principle is simple, the deadlock situation in system service can be detected accurately and in time, to make timely, flexible response to deadlock, so as to ensure the normal operation of system available for the thread deadlock of a variety of nucleus modules.
Description
Technical field
The present invention relates to operating system failure management domain, more particularly to a kind of thread detection method, terminal and computer
Readable storage medium storing program for executing.
Background technology
SystemServer and system service, which have, runs nearly 100 kinds in important relationship, SystemServer processes
Service, and almost all of kernel service is run all in this process in system, for example
ActivityManagerService, PowerManagerService and WindowManagerService etc., once these take
Business goes wrong, by the normal operation of the system of influence.Therefore, it is necessary to the operation shape of the various services in SystemServer
State is monitored.
Deadlock be multiple threads (process) in the process of implementation, caused due to competitive resource or due to communicating with one another
A kind of phenomenon of obstruction.For example, if thread 1 needs to complete certain task by resource A and B, now thread 1 has pinned A, then
Trial is locked to B;But at the same time, thread 2 needs to complete another task by resource A and B, and now thread 2 has been locked
B has been lived, has then attempted to lock A, at this moment deadlock just there occurs;Thread 1 cannot get B forever, and thread 2 also forever cannot
A, and they do not know that always and there occurs such thing;In order to obtain mutual object (A and B), they will be eternal
Obstruction goes down.System can be now claimed to generate deadlock in deadlock state or system, these forever can in the thread waited mutually
Referred to as deadlock thread;When deadlock occurs in thread, the normal process of the business in deadlock thread can be influenceed, but also can take and be
System resource, influences other threads.Deadlock state is once form, and process can not be solved automatically, it is necessary to outer power effect in itself
It could solve;And can not be found and solve in time if occurring deadlock in system core service, system by cisco unity malfunction,
Even there is application program without response (ANR, Application Not Responding) or even crash.
Therefore, it is necessary to deadlock is detected using general, the reliable testing mechanism of one kind, it is timely, flexible to be made to deadlock
Response.
The content of the invention
It is a primary object of the present invention to propose a kind of thread detection method, device and computer-readable recording medium, purport
Detected to system core module, to find deadlock situation in time.
To achieve the above object, the present invention provides a kind of thread detection method, and the thread detection method includes following step
Suddenly:
In task thread dispatching nucleus module, the nucleus module is locked by presetting public lock;
Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine
Whether the nucleus module can use;
If failing to get the default public lock in default time-out time, it is determined that the nucleus module is unavailable,
And determine that the mission thread and nucleus module there occurs deadlock.
Optionally, if described fail to get the default public lock in default time-out time, it is determined that the core
Module is unavailable, and after determining the step of mission thread and nucleus module there occurs deadlock, in addition to:
The deadlock information of deadlock module is obtained, and the deadlock information is preserved to local and/or server.
Optionally, if described fail to get the default public lock in default time-out time, it is determined that the core
Module is unavailable, and after determining the step of mission thread and nucleus module there occurs deadlock, in addition to:
Deadlock task thread is hung up, and discharges the nucleus module and presets public lock.
Optionally, it is described hang-up deadlock task thread, and discharge the nucleus module and preset public lock the step of after,
Also include:
When by default suspension time, the deadlock task thread is restarted.
Optionally, if described fail to get the default public lock in default time-out time, it is determined that the core
Module is unavailable, and after determining the step of mission thread and nucleus module there occurs deadlock, in addition to:
Stop all threads, and restarting systems.
In addition, to realize object above, the present invention also provides a kind of thread detection terminal, and the thread detection terminal includes
Processor, memory and it is stored on the memory and program can be detected by the thread of the computing device, wherein described
Thread realizes following steps when detecting program by the computing device:
In task thread dispatching nucleus module, the nucleus module is locked by presetting public lock;
Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine
Whether the nucleus module can use;
If failing to get the default public lock in default time-out time, it is determined that the nucleus module is unavailable,
And determine that the mission thread and nucleus module there occurs deadlock.
Optionally, when the thread detects program by the computing device, following steps are also realized:
The deadlock information of deadlock module is obtained, and the deadlock information is preserved to local and/or server.
Optionally, when the thread detects program by the computing device, following steps are also realized:
Deadlock task thread is hung up, and discharges the nucleus module and presets public lock;
When by default suspension time, the deadlock task thread is restarted.
Optionally, when the thread detects program by the computing device, following steps are also realized:
Stop all threads, and restarting systems.
In addition, to realize object above, the present invention also provides a kind of computer-readable recording medium, described computer-readable
The thread that is stored with storage medium detects program, and the thread detection program realizes thread inspection described above when being executed by processor
The step of survey method.
The present invention by presetting public lock to the nucleus module by task thread dispatching nucleus module, being locked
It is fixed;Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine the core
Whether core module can use;If failing to get the default public lock in default time-out time, it is determined that the nucleus module
It is unavailable, and determine that the mission thread and nucleus module there occurs deadlock.By the way that with upper type, the present invention need not detect core
In the case of core module, public lock is preset to nucleus module correspondence and detected, if can not all get at the appointed time pre-
If public lock, then it is assumed that deadlock occurs in nucleus module.The thread detection method of the present embodiment can be used for the line of a variety of nucleus modules
Journey Deadlock Detection, its principle is simple, the deadlock situation in system can be detected accurately and in time, to make timely, spirit to deadlock
Response living, so as to ensure the normal operation of system.
Brief description of the drawings
Fig. 1 detects terminal hardware structural representation for the thread of realization each embodiment of the invention;
Fig. 2 is the schematic flow sheet of thread detection method first embodiment of the present invention;
Fig. 3 is the schematic flow sheet of thread detection method second embodiment of the present invention;
Fig. 4 is the schematic flow sheet of thread detection method 3rd embodiment of the present invention;
Fig. 5 is the schematic flow sheet of thread detection method fourth embodiment of the present invention;
Fig. 6 is the schematic flow sheet of the embodiment of thread detection method the 5th of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only
Be conducive to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can be mixed
Ground is used.
In scheme of the embodiment of the present invention, thread detection method is applied to thread and detects terminal, and thread detection terminal can be with
Implement in a variety of manners.For example, the thread detection terminal described in the present invention can include such as mobile phone, tablet personal computer, pen
Remember this computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable media play
The mobile terminals such as device (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer,
And the fixed terminal such as numeral TV, desktop computer.
Thread detection terminal in subsequent descriptions will be illustrated by taking mobile terminal as an example, it will be appreciated by those skilled in the art that
, in addition to being used in particular for moving the element of purpose, construction according to the embodiment of the present invention can also apply to admittedly
Determine the terminal of type.
Referring to Fig. 1, thread detection terminal hardware structural representations of the Fig. 1 for realization each embodiment of the invention, the end
End 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A/V
(audio/video) input block 104, sensor 105, display unit 106, user input unit 107, interface unit 108, storage
The parts such as device 109, processor 110 and power supply 111.It will be understood by those skilled in the art that the terminal structure shown in Fig. 1
The restriction that terminal is detected to thread is not constituted, thread detection terminal can include parts more more or less than diagram, or
Combine some parts, or different part arrangements.
The all parts of terminal, which are specifically introduced, to be detected to thread with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station
Downlink information receive after, handled to processor 110;In addition, up data are sent into base station.Generally, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating
Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
WiFi belongs to short range wireless transmission technology, and thread detection terminal can help user to receive by WiFi module 102
Send e-mails, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although figure
1 show WiFi module 102, but it is understood that, it is simultaneously not belonging to thread detection terminal and must be configured into, completely can be with
Omitted as needed in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, note in thread detection terminal 100
When under the isotypes such as record pattern, speech recognition mode, broadcast reception mode, radio frequency unit 101 or WiFi module 102 are received
Or the voice data stored in memory 109 is converted into audio signal and is output as sound.Moreover, audio output unit
103 can also provide the audio output related to the specific function that terminal 100 is performed (for example, call signal receives sound, message
Receive sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042,1041 pairs of graphics processor is in video acquisition mode
Or the view data progress of the static images or video obtained in image capture mode by image capture apparatus (such as camera)
Reason.Picture frame after processing may be displayed on display unit 106.Picture frame after being handled through graphics processor 1041 can be deposited
Storage is transmitted in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio (voice) data after processing can
To be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model.
Microphone 1042 can implement various types of noises and eliminate (or suppression) algorithm to eliminate (or suppression) in reception and send sound
The noise produced during frequency signal or interference.
Thread detection terminal 100 also includes at least one sensor 105, such as optical sensor, motion sensor and its
His sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can basis
The light and shade of ambient light adjusts the brightness of display panel 1061, and proximity transducer can be moved to ear in thread detection terminal 100
Bian Shi, closes display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect each side
The size of (generally three axles) acceleration, can detect that size and the direction of gravity, available for identification mobile phone appearance upwards when static
The application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating) of state, Vibration identification correlation function (such as pedometer,
Tap) etc.;The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope,
The other sensors such as barometer, hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can be wrapped
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and generation and the user of terminal to set
Put and the input of key signals that function control is relevant.Specifically, user input unit 107 may include contact panel 1071 and its
His input equipment 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation (ratio of the user on or near it
Such as user is using finger, any suitable object of stylus or annex on contact panel 1071 or near contact panel 1071
Operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detecting apparatus
With two parts of touch controller.Wherein, touch detecting apparatus detects the touch orientation of user, and detects what touch operation was brought
Signal, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and it is changed
Into contact coordinate, then give processor 110, and the order sent of reception processing device 110 and can be performed.Furthermore, it is possible to adopt
Contact panel 1071 is realized with polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can be wrapped
Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc.
One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, with preprocessor 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel
1061 be input and the output function that terminal is realized as two independent parts, but in some embodiments it is possible to will
Contact panel 1071 and display panel 1061 are integrated and realize the input of thread detection terminal and output function, do not do herein specifically
Limit.
Interface unit 108 is used as at least one external device (ED) and is connected the interface that can pass through with thread detection terminal 100.Example
Such as, external device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, You Xianhuo
Wireless data communications port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and by the input received be transferred to thread detect one or more elements in terminal 100 or
It can be used for detecting in thread and transmit data between terminal 100 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area
And storage data field, wherein, application program (the such as sound that storing program area can be needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data field can be stored uses created data (such as according to mobile phone
Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, it can also include non-easy
The property lost memory, for example, at least one disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is thread detection terminal control center, is detected eventually using various interfaces and the whole thread of connection
The various pieces at end, software program and/or module in memory 109 are stored in by operation or execution, and call storage
Data in memory 109, execution thread detects the various functions and processing data of terminal, so as to enter to thread detection terminal
Row integral monitoring.Processor 110 may include one or more processing units;It is preferred that, processor 110 can integrated application processor
And modem processor, wherein, application processor mainly handles operating system, user interface and application program etc., modulatedemodulate
Processor is adjusted mainly to handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor
In 110.
Thread detection terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that electricity
Source 111 can be logically contiguous by power-supply management system and processor 110, so as to realize that management is filled by power-supply management system
The functions such as electricity, electric discharge and power managed.
Although Fig. 1 is not shown, thread detection terminal 100 can also will not be repeated here including bluetooth module etc..
The hardware configuration of terminal is detected based on above-mentioned thread, each embodiment of thread detection method of the present invention is proposed.
Reference picture 2, Fig. 2 is the schematic flow sheet of thread detection method first embodiment of the present invention.
In the present embodiment, the thread detection method comprises the following steps:
Step S10, in task thread dispatching nucleus module, is locked by presetting public lock to the nucleus module
It is fixed;
Deadlock be multiple threads (process) in the process of implementation, caused due to competitive resource or due to communicating with one another
A kind of phenomenon of obstruction.For example, if thread 1 needs to complete certain task by resource A and B, now thread 1 has pinned A, then
Trial is locked to B;But at the same time, thread 2 needs to complete another task by resource A and B, and now thread 2 has been locked
B has been lived, has then attempted to lock A, at this moment deadlock just there occurs;Thread 1 cannot get B forever, and thread 2 also forever cannot
A, and they do not know that always and there occurs such thing;In order to obtain mutual object (A and B), they will be eternal
Obstruction goes down.System can be now claimed to generate deadlock in deadlock state or system, these forever can in the thread waited mutually
Referred to as deadlock thread;When deadlock occurs in thread, the normal process of the business in deadlock thread can be influenceed, but also can take and be
System resource, influences other threads.Deadlock state is once form, and process can not be solved automatically, it is necessary to outer power effect in itself
It could solve;And can not be found and solve in time if occurring deadlock in system core module, system by cisco unity malfunction,
Even there is application program without response (ANR, Application Not Responding) or even crash.
For these reasons, a kind of thread detection method is proposed in the present embodiment, to key core mould all in system
Block is monitored using the monitoring mechanism of standard, to find deadlock in time, it is to avoid thread block and resource are taken for a long time.
Specifically, the thread detection method of the present embodiment can apply to thread detection terminal, thread detection terminal can
Implement with a variety of manners, illustrated in the present embodiment with mobile phone, certain thread detection terminal can also include flat board electricity
Brain, notebook computer, palm PC, personal digital assistant, guider, wearable device, Intelligent bracelet, pedometer etc. are mobile
Terminal, and the fixed terminal such as numeral TV, desktop computer.
In the present embodiment, nearly 100 kinds nucleus modules, and almost mobile phone are run in the SystemServer of mobile phone
All nucleus modules in system are all run in SystemServer, such as ActivityManagerService,
PowerManagerService and WindowManagerService etc., when cell phone system starts and finished, these nucleus modules
Upstate will be in.After handset starting, user, which clicks on, starts some application, will trigger corresponding operational order;Mobile phone
When receiving the operational order of user's triggering, corresponding assignment instructions will be generated, and opens mission thread and handles the task and refer to
Order, is responded with the operational order to user.And, it is necessary to use system during task thread process assignment instructions
Core Feature, now, the mission thread will call corresponding nucleus module.And for nucleus module, in order to avoid two
More than (herein " more than " include this number, similarly hereinafter) mission thread simultaneously using data corruption caused by same nucleus module with
System exception situation occurs, when each nucleus module is called by a mission thread, will be by presetting public lock by the core mould
Block is locked, and refuses the call request of other threads;When thread dispatching is finished, the nucleus module can be just unlocked, now other
Mission thread can just be called.
Further, can be each nucleus module one public lock of correspondence, can also be to join in practical operation
Closely multiple nucleus modules are as a set for system, a common corresponding public lock, for example, nucleus module a, b, c, these three
The contact of nucleus module is more close, when calling one of module, generally requires while calling other two modules to carry out
Collaboration is handled, then now can be by tri- nucleus modules of a, b, c, one public lock of common correspondence, as long as mission thread have invoked it
In any one module, then public lock these three modules are locked simultaneously automatically so that other threads can not be called, so as to ensure
The integrality of task resource, reduces the generation of deadlock.
Step S20, open detection thread, and detect that thread periodicallys attempt to obtain described default public by described
Lock, to determine whether the module can use;
,, all can be by corresponding pre- when it is called by mission thread for each nucleus module in the present embodiment
If public lock locking.According to this characteristic, the present embodiment can judge nucleus module according to the use state for presetting public lock
Upstate;If presetting public lock can be obtained by other threads, illustrate that this is preset public lock and is not used, that is to say, that corresponding
Nucleus module is in upstate, and the nucleus module is not called by mission thread;If presetting public lock can not be obtained by other threads
Take, then illustrate that this is preset public lock and used, that is to say, that corresponding nucleus module is in lock-out state, the nucleus module
Just called by mission thread.
Specifically, in the present embodiment, when some nucleus module is called by mission thread, the system of mobile phone will open one
New detection thread, to attempt to obtain the corresponding default public lock of called nucleus module, so as to make to presetting public lock
Detected with situation, to determine the state of the nucleus module.Wherein, the acquisition action of detection thread is periodic, for example,
After open detection thread, detection thread, which can be attempted to obtain, presets public lock, if this fails to get default public lock, says
It is bright now to preset public lock in use, detection thread again attempt to obtain after 2s;After 2s, detection thread can be again
Attempt to obtain and preset public lock, this still fails to get default public lock, then illustrates that now presetting public lock is still using
In, detection thread can again attempt to obtain after 2s;The rest may be inferred, until detection thread, which has been got, presets public lock, detection
Thread just stops obtaining operation;And if in default time-out time, detection thread all fails to get the default public lock,
Then illustrate that corresponding nucleus module is constantly in lock-out state, other mission threads can not be called to it, now enter step
Rapid S30.
Further, can be that the function as associated by system automatically according to nucleus module should for presetting time-out time
With what is voluntarily set.For example, the application that nucleus module a is related to there are 5, illustrate there are 5 applications to use nucleus module a,
Then accordingly nucleus module a default time-out time can be set shorter, it is ensured that each module will not take nucleus module a
Long time;And the application that nucleus module a is related to only 1, then nucleus module a default time-out time can be set accordingly
Obtain longer.The default time-out time of nucleus module can also be set according to other modes certainly.In addition, all cores in system
The time-out time of core module can also be likewise, the present embodiment is not limited.
Step S30, if failing to get the default public lock in default time-out time, it is determined that the module can not
With, and determine that the mission thread and nucleus module there occurs deadlock.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, cause other mission threads can not be called to it, will now recognize
The nucleus module and to call the mission thread of the nucleus module to there occurs deadlock.
Further, for nucleus module in system, it monitors interface implement Monitor interfaces, can be this
Sample:
public interface Monitor{
void monitor();
}
Wherein, monitoring method can be realized in:
public void monitor(){
synchronized(this){}
}
And in the thread detection method of the present embodiment, its detection part code can be such:
Certainly, above-mentioned code is only that typical case in the present embodiment realizes code, does not constitute the restriction to the present embodiment.
Thread detection method in the present embodiment can also be realized by other codes.
Further, if getting the default public lock in default time-out time, illustrated to have preset public lock
It is released, illustrates that corresponding nucleus module has also been released, in upstate;Because nucleus module is in default time-out time
It is released, it may be determined that nucleus module is in normal condition, and calls the mission thread of the nucleus module also normal operation;Now examine
Survey line journey also will correspondingly stop.
In the present embodiment, by task thread dispatching nucleus module, by presetting public lock to the nucleus module
Locked;Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine
Whether the nucleus module can use;If failing to get the default public lock in default time-out time, it is determined that the core
Core module is unavailable, and determines that the mission thread and nucleus module there occurs deadlock.By the way that with upper type, the present embodiment is in nothing
In the case of nucleus module need to being detected, public lock is preset to nucleus module correspondence and detected, if all can not at the appointed time
Get default public lock, then it is assumed that deadlock occurs in nucleus module.The thread detection method of the present embodiment can be used for a variety of cores
The thread deadlock detection of module, its principle is simple, the deadlock situation in system can be detected accurately and in time, to make to deadlock
Go out timely, flexible response, so as to ensure the normal operation of system.
Reference picture 3, Fig. 3 is the schematic flow sheet of thread detection method second embodiment of the present invention.
Based on above-mentioned embodiment illustrated in fig. 2, after step S30, in addition to:
Step S40, obtains the deadlock information of deadlock module, and the deadlock information is preserved to local and/or server.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.When it is determined that deadlock occurs for nucleus module, cell phone system will obtain the related deadlock information of deadlock module,
For example, the nucleus module of deadlock call initial time, call the duration, call the nucleus module deadlock thread thread appoint
Business, the mission thread relevant information blocked mutually with damned locking wire journey etc..
When getting these related deadlock information, mobile phone will record these related deadlock information, and be stored in
In mobile phone local memory, checked and analyzed for user.Certain mobile phone is also uploaded these deadlock information by network
Preserved into server, be provided with pass staff and these deadlock information are analyzed, so that the system to mobile phone is carried out
Optimization.
Further, mobile phone is when deadlock information is uploaded onto the server, and server can also determine phase according to deadlock information
The processing mode answered, while the processing mode is write into configuration file with certain format, mobile phone is being returned by the configuration file;Hand
Machine will read the configuration file and system be adjusted and set, to solve Deadlock when receiving the configuration file.When
Right server can make mobile phone perform corresponding operation, asked with solving deadlock directly to mobile phone return command row (operational order)
Topic.Server can also be to mobile phone return system AKU, to upgrade to cell phone system, to solve Deadlock.
In the present embodiment, when deadlock occurs for nucleus module, the deadlock information of correlation can be obtained automatically, and the information is protected
Deposit, so that subsequent analysis and optimization are used.
Reference picture 4, Fig. 4 is the schematic flow sheet of thread detection method 3rd embodiment of the present invention.
Based on above-mentioned embodiment illustrated in fig. 2, after step S30, in addition to:
Step S50, hangs up deadlock task thread, and discharge the nucleus module and preset public lock.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.Because deadlock is multiple threads (process) in the process of implementation caused by resource contention, therefore can lead to
Cross and release one of the resource of deadlock thread and carry out Dead lock.For example, in the present embodiment, mission thread 1 and the core called
Deadlock occurs for module a, then illustrates that mission thread 1 can not call nucleus module b necessary to another task so as to complete thread task;
And it is now inevitable also there is mission thread 2 and nucleus module b to occur deadlock, mission thread 2 can not core mould necessary to calling task
Block a is so as to complete thread task;Now in order to release unblock, first mission thread 1 can be hung up, temporary transient aborting task thread 1
Thread task, first the nucleus module of mission thread 1 and default public lock are discharged, other mission thread can first have been called
Into task, so that Dead lock, enables cell phone system normally to run.
Further,, can be by releasing one of deadlock thread when deadlock occurs for thread as above-mentioned analysis
Resource carrys out Dead lock, and is to hang up deadlock thread 1 in the present embodiment, release nucleus module a.It is, of course, also possible to be will be dead
Locking wire journey 2 is hung up, and discharges its nucleus module b called so that mission thread thread 1 can first call nucleus module b to complete
Thread task, so as to release unblock.
Further, in specific implementation, for each nucleus module, it can also be set not according to its own attribute
Same Deadlock release method.For example when deadlock occurs for nucleus module a, always first the mission thread for calling nucleus module a is hung
Rise, to discharge nucleus module a and corresponding public lock, for other thread dispatching nucleus modules a.Certainly can also be according to actual feelings
Condition carries out flexible configuration.
, can when deadlock occurs for the nucleus module for finding that a certain mission thread and the mission thread are called in the present embodiment
First by damned lock thread suspension, to discharge the nucleus module that it is called so that other threads can be with normal process, it is ensured that system is just
Often operation.
Reference picture 5, Fig. 5 is the schematic flow sheet of thread detection method fourth embodiment of the present invention.
Based on above-mentioned embodiment illustrated in fig. 4, after step S50, in addition to:
Step S60, when by default suspension time, restarts the deadlock task thread.
In the present embodiment, the mission thread of deadlock was hung up after a period of time, because the resource of now caused deadlock is competing
The problem of striving may disappear, and others competition thread has completed the thread task of itself, can now restart hang-up
Deadlock task thread, makes it start the process over original thread task, to ensure that original task can be handled, it is ensured that be
The normal operation of system.
Reference picture 6, Fig. 6 is the schematic flow sheet of the embodiment of thread detection method the 5th of the present invention.
Based on above-mentioned embodiment illustrated in fig. 2, after step S30, in addition to:
Step S70, stops all threads, and restarting systems.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.Occur deadlock when, if the resource contention number that deadlock is related to is more, deadlock thread blocking relationship compared with
For complexity, it is impossible to by hanging up a certain deadlock thread come Dead lock, then now can directly stop all threads, and open again
Dynamic system, that is, restart mobile phone, handled again again with being initialized to each thread task, it is to avoid system resource takes for a long time
Processing task can not be completed again.
In addition, the present invention also provides a kind of thread detection terminal.
With continued reference to Fig. 2, thread detection terminal of the present invention includes processor, memory and is stored on the memory simultaneously
Can by the computing device thread detect program, wherein the thread detect program by during the computing device realize with
Lower step:
Step S10, in task thread dispatching nucleus module, is locked by presetting public lock to the nucleus module
It is fixed;
Deadlock be multiple threads (process) in the process of implementation, caused due to competitive resource or due to communicating with one another
A kind of phenomenon of obstruction.For example, if thread 1 needs to complete certain task by resource A and B, now thread 1 has pinned A, then
Trial is locked to B;But at the same time, thread 2 needs to complete another task by resource A and B, and now thread 2 has been locked
B has been lived, has then attempted to lock A, at this moment deadlock just there occurs;Thread 1 cannot get B forever, and thread 2 also forever cannot
A, and they do not know that always and there occurs such thing;In order to obtain mutual object (A and B), they will be eternal
Obstruction goes down.System can be now claimed to generate deadlock in deadlock state or system, these forever can in the thread waited mutually
Referred to as deadlock thread;When deadlock occurs in thread, the normal process of the business in deadlock thread can be influenceed, but also can take and be
System resource, influences other threads.Deadlock state is once form, and process can not be solved automatically, it is necessary to outer power effect in itself
It could solve;And can not be found and solve in time if occurring deadlock in system core module, system by cisco unity malfunction,
Even there is application program without response (ANR, Application Not Responding) or even crash.
For these reasons, a kind of thread detection terminal is proposed in the present embodiment, nucleus module all in system is adopted
It is monitored with the monitoring mechanism of standard, to find deadlock in time, it is to avoid thread block and resource are taken for a long time.
Specifically, the thread detection method of the present embodiment can apply to thread detection terminal, thread detection terminal can
Implement with a variety of manners, illustrated in the present embodiment with mobile phone, certain thread detection terminal can also include flat board electricity
Brain, notebook computer, palm PC, personal digital assistant, guider, wearable device, Intelligent bracelet, pedometer etc. are mobile
Terminal, and the fixed terminal such as numeral TV, desktop computer.
In the present embodiment, nearly 100 kinds nucleus modules, and almost mobile phone are run in the SystemServer of mobile phone
All nucleus modules in system are all run in SystemServer, such as ActivityManagerService,
PowerManagerService and WindowManagerService etc., when cell phone system starts and finished, these nucleus modules
Upstate will be in.After handset starting, user, which clicks on, starts some application, will trigger corresponding operational order;Mobile phone
When receiving the operational order of user's triggering, corresponding assignment instructions will be generated, and opens mission thread and handles the task and refer to
Order, is responded with the operational order to user.And, it is necessary to use system during task thread process assignment instructions
Core Feature, now, the mission thread will call corresponding nucleus module.And for nucleus module, in order to avoid two
More than (herein " more than " include this number, similarly hereinafter) mission thread simultaneously using same nucleus module be engaged in caused by data corruption
Occur with system exception situation, will be by presetting public lock by the core when each nucleus module is called by a mission thread
Module is locked, and refuses the call request of other threads;When thread dispatching is finished, the nucleus module can be just unlocked, now its
Its mission thread can just be called.
Further, can be each nucleus module one public lock of correspondence, can also be to join in practical operation
Closely multiple nucleus modules are as a set for system, a common corresponding public lock, for example, nucleus module a, b, c, these three
The contact of nucleus module is more close, when calling one of module, generally requires while calling other two modules to carry out
Collaboration is handled, then now can be by tri- nucleus modules of a, b, c, one public lock of common correspondence, as long as mission thread have invoked it
In any one module, then public lock these three modules are locked simultaneously automatically so that other threads can not be called, so as to ensure
The integrality of task resource, reduces the generation of deadlock.
Step S20, open detection thread, and detect that thread periodicallys attempt to obtain described default public by described
Lock, to determine whether the module can use;
,, all can be by corresponding pre- when it is called by mission thread for each nucleus module in the present embodiment
If public lock locking.According to this characteristic, the present embodiment can judge nucleus module according to the use state for presetting public lock
Upstate;If presetting public lock can be obtained by other threads, illustrate that this is preset public lock and is not used, that is to say, that corresponding
Nucleus module is in upstate, and the nucleus module is not called by mission thread;If presetting public lock can not be obtained by other threads
Take, then illustrate that this is preset public lock and used, that is to say, that corresponding nucleus module is in lock-out state, the nucleus module
Just called by mission thread.
Specifically, in the present embodiment, when some nucleus module is called by mission thread, the system of mobile phone will open one
New detection thread, to attempt to obtain the corresponding default public lock of called nucleus module, so as to make to presetting public lock
Detected with situation, to determine the state of the nucleus module.Wherein, the acquisition action of detection thread is periodic, for example,
After open detection thread, detection thread, which can be attempted to obtain, presets public lock, if this fails to get default public lock, says
It is bright now to preset public lock in use, detection thread again attempt to obtain after 2s;After 2s, detection thread can be again
Attempt to obtain and preset public lock, this still fails to get default public lock, then illustrates that now presetting public lock is still using
In, detection thread can again attempt to obtain after 2s;The rest may be inferred, until detection thread, which has been got, presets public lock, detection
Thread just stops obtaining operation;And if in default time-out time, detection thread all fails to get the default public lock,
Then illustrate that corresponding nucleus module is constantly in lock-out state, other mission threads can not be called to it, now enter step
Rapid S30.
Further, can be that the function as associated by system automatically according to nucleus module should for presetting time-out time
With what is voluntarily set.For example, the application that nucleus module a is related to there are 5, illustrate there are 5 applications to use nucleus module a,
Then accordingly nucleus module a default time-out time can be set shorter, it is ensured that each module will not take nucleus module a
Long time;And the application that nucleus module a is related to only 1, then nucleus module a default time-out time can be set accordingly
Obtain longer.The default time-out time of nucleus module can also be set according to other modes certainly.In addition, all cores in system
The time-out time of core module can also be likewise, the present embodiment is not limited.
Step S30, if failing to get the default public lock in default time-out time, it is determined that the module can not
With, and determine that the mission thread and nucleus module there occurs deadlock.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, cause other mission threads can not be called to it, will now recognize
The nucleus module and to call the mission thread of the nucleus module to there occurs deadlock.
Further, for nucleus module in system, it monitors interface implement Monitor interfaces, can be this
Sample:
public interface Monitor{
void monitor();
}
Wherein, monitoring method can be realized in:
public void monitor(){
synchronized(this){}
}
And detect that in terminal, its detection part code can be such for the thread of the present embodiment:
Certainly, above-mentioned code is only that typical case in the present embodiment realizes code, does not constitute the restriction to the present embodiment.
Thread detection terminal in the present embodiment can also be realized by other codes.
Further, if getting the default public lock in default time-out time, illustrated to have preset public lock
It is released, illustrates that corresponding nucleus module has also been released, in upstate;Because nucleus module is in default time-out time
It is released, it may be determined that nucleus module is in normal condition, and calls the mission thread of the nucleus module also normal operation;Now examine
Survey line journey also will correspondingly stop.
In the present embodiment, by task thread dispatching nucleus module, by presetting public lock to the nucleus module
Locked;Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, to determine
Whether the nucleus module can use;If failing to get the default public lock in default time-out time, it is determined that the core
Core module is unavailable, and determines that the mission thread and nucleus module there occurs deadlock.By the way that with upper type, the present embodiment is in nothing
In the case of nucleus module need to being detected, public lock is preset to nucleus module correspondence and detected, if all can not at the appointed time
Get default public lock, then it is assumed that deadlock occurs in nucleus module.The thread detection terminal of the present embodiment can be used for multiple module
Thread deadlock detection, its principle is simple, and the deadlock situation in system can be detected accurately and in time, to be made to deadlock and
When, flexible response, so as to ensure the normal operation of system.
With continued reference to Fig. 3, when the thread detects program by the computing device, following steps are also realized:
Step S40, obtains the deadlock information of deadlock module, and the deadlock information is preserved to local and/or server.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.When it is determined that deadlock occurs for nucleus module, cell phone system will obtain the related deadlock information of deadlock module,
For example, the nucleus module of deadlock call initial time, call the duration, call the nucleus module deadlock thread thread appoint
Business, the mission thread relevant information blocked mutually with damned locking wire journey etc..
When getting these related deadlock information, mobile phone will record these related deadlock information, and be stored in
In mobile phone local memory, checked and analyzed for user.Certain mobile phone is also uploaded these deadlock information by network
Preserved into server, be provided with pass staff and these deadlock information are analyzed, so that the system to mobile phone is carried out
Optimization.
Further, mobile phone is when deadlock information is uploaded onto the server, and server can also determine phase according to deadlock information
The processing mode answered, while the processing mode is write into configuration file with certain format, mobile phone is being returned by the configuration file;Hand
Machine will read the configuration file and system be adjusted and set, to solve Deadlock when receiving the configuration file.When
Right server can make mobile phone perform corresponding operation, asked with solving deadlock directly to mobile phone return command row (operational order)
Topic.Server can also be to mobile phone return system AKU, to upgrade to cell phone system, to solve Deadlock.
In the present embodiment, when deadlock occurs for nucleus module, the deadlock information of correlation can be obtained automatically, and the information is protected
Deposit, so that subsequent analysis and optimization are used.
With continued reference to Fig. 4, when the thread detects program by the computing device, following steps are also realized:
Based on above-mentioned embodiment illustrated in fig. 2, after step S30, in addition to:
Step S50, hangs up deadlock task thread, and discharge the nucleus module and preset public lock.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.Because deadlock is multiple threads (process) in the process of implementation caused by resource contention, therefore can lead to
Cross and release one of the resource of deadlock thread and carry out Dead lock.For example, in the present embodiment, mission thread 1 and the core called
Deadlock occurs for module a, then illustrates that mission thread 1 can not call nucleus module b necessary to another task so as to complete thread task;
And it is now inevitable also there is mission thread 2 and nucleus module b to occur deadlock, mission thread 2 can not core mould necessary to calling task
Block a is so as to complete thread task;Now in order to release unblock, first mission thread 1 can be hung up, temporary transient aborting task thread 1
Thread task, first the nucleus module of mission thread 1 and default public lock are discharged, other mission thread can first have been called
Into task, so that Dead lock, enables cell phone system normally to run.
Further,, can be by releasing one of deadlock thread when deadlock occurs for thread as above-mentioned analysis
Resource carrys out Dead lock, and is to hang up deadlock thread 1 in the present embodiment, release nucleus module a.It is, of course, also possible to be will be dead
Locking wire journey 2 is hung up, and discharges its nucleus module b called so that mission thread thread 1 can first call nucleus module b to complete
Thread task, so as to release unblock.
Further, in specific implementation, for each nucleus module, it can also be set not according to its own attribute
Same Deadlock release method.For example when deadlock occurs for nucleus module a, always first the mission thread for calling nucleus module a is hung
Rise, to discharge nucleus module a and corresponding public lock, for other thread dispatching nucleus modules a.Certainly can also be according to actual feelings
Condition carries out flexible configuration.
, can when deadlock occurs for the nucleus module for finding that a certain mission thread and the mission thread are called in the present embodiment
First by damned lock thread suspension, to discharge the nucleus module that it is called so that other threads can be with normal process, it is ensured that system is just
Often operation.
With continued reference to Fig. 5, when the thread detects program by the computing device, following steps are also realized:
Step S60, when by default suspension time, restarts the deadlock task thread.
In the present embodiment, the mission thread of deadlock was hung up after a period of time, because the resource of now caused deadlock is competing
The problem of striving may disappear, and others competition thread has completed the thread task of itself, can now restart hang-up
Deadlock task thread, makes it start the process over original thread task, to ensure that original task can be handled, it is ensured that be
The normal operation of system.
With continued reference to Fig. 6, when the thread detects program by the computing device, following steps are also realized:
Step S70, stops all threads, and restarting systems.
In the present embodiment, if in default time-out time, detection thread all fails to get the default public lock, then
Illustrate that corresponding nucleus module is constantly in lock-out state, now will be considered to the nucleus module and call the task of the nucleus module
Thread there occurs deadlock.Occur deadlock when, if the resource contention number that deadlock is related to is more, deadlock thread blocking relationship compared with
For complexity, it is impossible to by hanging up a certain deadlock thread come Dead lock, then now can directly stop all threads, and open again
Dynamic system, that is, restart mobile phone, handled again again with being initialized to each thread task, it is to avoid system resource takes for a long time
Processing task can not be completed again.
In addition, the present invention also provides a kind of computer-readable recording medium.
The thread that is stored with computer-readable recording medium of the present invention detects program, and the thread detects program by processor
The step of thread detection method as described above is realized during execution.
Wherein, the step of being realized when thread detection program is performed can refer to thread detection method of the present invention each
Embodiment, here is omitted.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Understood based on such, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be mobile phone, computer, clothes
It is engaged in device, air conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair
Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of thread detection method, it is characterised in that the thread detection method comprises the following steps:
In task thread dispatching nucleus module, the nucleus module is locked by presetting public lock;
Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, it is described to determine
Whether nucleus module can use;
If fail to get the default public lock in default time-out time, it is determined that the nucleus module is unavailable, and really
The fixed mission thread and nucleus module there occurs deadlock.
2. thread detection method as claimed in claim 1, it is characterised in that if described fail to obtain in default time-out time
Public lock is preset to described, it is determined that the nucleus module is unavailable, and determines that the mission thread and nucleus module there occurs
After the step of deadlock, in addition to:
The deadlock information of deadlock module is obtained, and the deadlock information is preserved to local and/or server.
3. thread detection method as claimed in claim 1, it is characterised in that if described fail to obtain in default time-out time
Public lock is preset to described, it is determined that the nucleus module is unavailable, and determines that the mission thread and nucleus module there occurs
After the step of deadlock, in addition to:
Deadlock task thread is hung up, and discharges the nucleus module and presets public lock.
4. thread detection method as claimed in claim 3, it is characterised in that the hang-up deadlock task thread, and discharge institute
After the step of stating nucleus module and preset public lock, in addition to:
When by default suspension time, the deadlock task thread is restarted.
5. the thread detection method as any one of Claims 1-4, it is characterised in that if described fail default super
When the time in get it is described preset public lock, it is determined that the nucleus module is unavailable, and determines the mission thread and core
After the step of core module there occurs deadlock, in addition to:
Stop all threads, and restarting systems.
6. a kind of thread detects terminal, it is characterised in that the thread detection terminal includes processor, memory and is stored in institute
State on memory and program can be detected by the thread of the computing device, wherein the thread detects program by the processor
Following steps are realized during execution:
In task thread dispatching nucleus module, the nucleus module is locked by presetting public lock;
Open detection thread, and the acquisition default public lock is periodicallyed attempt to by the detection thread, it is described to determine
Whether nucleus module can use;
If fail to get the default public lock in default time-out time, it is determined that the nucleus module is unavailable, and really
The fixed mission thread and nucleus module there occurs deadlock.
7. thread as claimed in claim 6 detects terminal, it is characterised in that the thread detection program is held by the processor
During row, following steps are also realized:
The deadlock information of deadlock module is obtained, and the deadlock information is preserved to local and/or server.
8. thread as claimed in claim 6 detects terminal, it is characterised in that the thread detection program is held by the processor
During row, following steps are also realized:
Deadlock task thread is hung up, and discharges the nucleus module and presets public lock;
When by default suspension time, the deadlock task thread is restarted.
9. the thread detection terminal as any one of claim 6 to 8, it is characterised in that the thread detects program quilt
During the computing device, following steps are also realized:
Stop all threads, and restarting systems.
10. a kind of computer-readable recording medium, it is characterised in that the thread that is stored with the computer-readable recording medium is examined
Ranging sequence, the thread detection program realizes the thread detection as any one of claim 1 to 5 when being executed by processor
The step of method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710421788.7A CN107247630A (en) | 2017-06-05 | 2017-06-05 | Thread detection method, terminal and computer-readable recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710421788.7A CN107247630A (en) | 2017-06-05 | 2017-06-05 | Thread detection method, terminal and computer-readable recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107247630A true CN107247630A (en) | 2017-10-13 |
Family
ID=60018565
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710421788.7A Pending CN107247630A (en) | 2017-06-05 | 2017-06-05 | Thread detection method, terminal and computer-readable recording medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107247630A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107967181A (en) * | 2017-12-19 | 2018-04-27 | 北京小米移动软件有限公司 | The control method and device of critical zone |
CN108052391A (en) * | 2017-11-30 | 2018-05-18 | 努比亚技术有限公司 | Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on thread deadlock |
CN110032435A (en) * | 2019-03-25 | 2019-07-19 | 北京和利时系统工程有限公司 | The method and apparatus of thread are managed in control system |
CN110851286A (en) * | 2019-11-12 | 2020-02-28 | 北京城市网邻信息技术有限公司 | Thread management method and device, electronic equipment and storage medium |
WO2024046089A1 (en) * | 2022-08-31 | 2024-03-07 | 华为技术有限公司 | Lock-holding process detection method and related device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1629821A (en) * | 2003-12-19 | 2005-06-22 | 华为技术有限公司 | Method and system for thread deadlock detection of multithread processor |
EP2037368A2 (en) * | 2007-07-30 | 2009-03-18 | Fujitsu Microelectronics Limited | Simulation of program execution to detect problem such as deadlock |
CN103761182A (en) * | 2013-12-26 | 2014-04-30 | 上海华为技术有限公司 | Method and device for deadlock detection |
CN105740080A (en) * | 2016-03-11 | 2016-07-06 | 深圳市茁壮网络股份有限公司 | Program sticking detection method and processor |
-
2017
- 2017-06-05 CN CN201710421788.7A patent/CN107247630A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1629821A (en) * | 2003-12-19 | 2005-06-22 | 华为技术有限公司 | Method and system for thread deadlock detection of multithread processor |
EP2037368A2 (en) * | 2007-07-30 | 2009-03-18 | Fujitsu Microelectronics Limited | Simulation of program execution to detect problem such as deadlock |
CN103761182A (en) * | 2013-12-26 | 2014-04-30 | 上海华为技术有限公司 | Method and device for deadlock detection |
CN105740080A (en) * | 2016-03-11 | 2016-07-06 | 深圳市茁壮网络股份有限公司 | Program sticking detection method and processor |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108052391A (en) * | 2017-11-30 | 2018-05-18 | 努比亚技术有限公司 | Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on thread deadlock |
CN107967181A (en) * | 2017-12-19 | 2018-04-27 | 北京小米移动软件有限公司 | The control method and device of critical zone |
CN110032435A (en) * | 2019-03-25 | 2019-07-19 | 北京和利时系统工程有限公司 | The method and apparatus of thread are managed in control system |
CN110032435B (en) * | 2019-03-25 | 2021-06-08 | 北京和利时系统工程有限公司 | Method and device for managing threads in control system |
CN110851286A (en) * | 2019-11-12 | 2020-02-28 | 北京城市网邻信息技术有限公司 | Thread management method and device, electronic equipment and storage medium |
CN110851286B (en) * | 2019-11-12 | 2023-02-17 | 北京城市网邻信息技术有限公司 | Thread management method and device, electronic equipment and storage medium |
WO2024046089A1 (en) * | 2022-08-31 | 2024-03-07 | 华为技术有限公司 | Lock-holding process detection method and related device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107247630A (en) | Thread detection method, terminal and computer-readable recording medium | |
CN107402709A (en) | A kind of multi-screen display method, terminal and computer-readable recording medium | |
CN109271121A (en) | A kind of application display method and mobile terminal | |
CN108459797A (en) | A kind of control method and mobile terminal of Folding screen | |
CN107861817A (en) | Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on thread block | |
CN110058836A (en) | A kind of output method and terminal device of audio signal | |
CN109697088A (en) | Application interface loading method, mobile terminal and computer readable storage medium | |
CN107590057A (en) | Freeze screen monitoring with solving method, mobile terminal and computer-readable recording medium | |
CN110062372A (en) | A kind of SIM card control method and terminal device | |
CN107704133A (en) | Freeze screen monitoring with solving method, mobile terminal and computer-readable recording medium | |
CN110366198A (en) | A kind of detection method and terminal of secondary cell group change result | |
CN110147186A (en) | A kind of control method and terminal device of application | |
CN107704363A (en) | Freeze screen monitoring method, mobile terminal and computer-readable recording medium | |
CN108681427A (en) | A kind of method and terminal device of access privilege control | |
CN109257505A (en) | A kind of screen control method and mobile terminal | |
CN107239275A (en) | Using operation method, terminal and computer-readable recording medium | |
CN108769399A (en) | A kind of message treatment method and terminal device | |
CN109803429A (en) | RRM measurement control method, mobile communication terminal and the network side equipment of adjacent cell | |
CN110232266A (en) | A kind of unlocking screen method and terminal device | |
CN110290269A (en) | Display control method, mobile terminal and computer readable storage medium | |
CN110012151A (en) | A kind of information display method and terminal device | |
CN109101301A (en) | A kind of display control method, mobile terminal and computer readable storage medium | |
CN109117037A (en) | A kind of method and terminal device of image procossing | |
CN107818036A (en) | Blank screen detection method, mobile terminal and computer-readable recording medium | |
CN107861827A (en) | Card screen detection method, mobile terminal and computer-readable recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171013 |
|
RJ01 | Rejection of invention patent application after publication |