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

Deadlock control method and device

A control method and deadlock technology, applied in the direction of program control design, multi-program device, program synchronization, etc., can solve problems such as large operating errors, program operating errors, and data loss, so as to ensure accuracy, avoid fatal damage, The effect of solving the deadlock problem

Active Publication Date: 2017-10-31
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

These two methods, because the execution of the thread is directly canceled, will more or less lose the data in the memory. In addition, when the canceled thread is executed again, the execution environment of the program has changed, so the program may be damaged. large error at runtime
[0004] It can be seen that the existing deadlock solutions have risk problems such as loss of data and large operating errors.

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
  • Deadlock control method and device
  • Deadlock control method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0021] The core idea of ​​the present invention is to modularize the codes requesting shared resources in the program codes of threads in advance, and adopt the method of thread rollback when a deadlock occurs, and select the thread with low rollback cost to roll back and release resources. In this way, the deadlock can be solved simply and quickly, and at the same time, since the execution of the thread does not need to be canceled, the problem of large operating errors caused by changes in the operating environment can be avoided.

[0022] figure 1 It is a schematic flow diagram of the method of the embodiment of the present invention, such as figure 1 As shown, the deadlock control method implemented in this embodiment mainly includes...

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 deadlock control method and device. The method comprises the following steps of: previously packaging codes needing to request shared resources in an application program into function modules; when the function modules are executed, storing context environment information in a rollback resource pool of threads; locking the requested shared resources; if the locking succeeds, triggering the threads to continue the execution, and otherwise, blocking the threads; when the threads need to release the shared resources, deleting the corresponding context information from the rollback resource pool of the threads; when deadlock occurs, determining a thread S1 which currently needs to release resources and a target function module to which the resources need to roll back when the resources are released; rolling back the context environment information in the resource pool by utilizing the thread S1, rolling back a to-be-executed position of the thread S1 to the target function module; and blocking the thread S1 and triggering the thread of the shared resource which currently waits for release to obtain the shared resource. According to the method and device, the deadlock problem can be rapidly solved, and the correctness of the program operation result can be ensured.

Description

technical field [0001] The invention relates to computer application information technology, in particular to a deadlock control method and device. Background technique [0002] In a highly concurrent multithreaded system, there are many resources that can only be used by one thread at a time. Several threads often desire to share these resources. But a thread often needs more than one resource. In this way, many threads will compete for limited resources. If the progress between threads is not appropriate, it is easy to cause multiple threads to occupy the resources expected by each other and wait in a loop. This situation is called deadlock. Once a deadlock occurs, the impact on the entire system is fatal. [0003] At present, there are usually two solutions to deadlocks, one is to restart the entire system; the other is to select a thread with a lower priority in the deadlocked threads to release resources and cancel the thread. These two methods, because the executi...

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/52
CPCG06F9/524
Inventor 魏亚文孙政
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD