Method for detecting and intervening deadlock of single-threading microprocessor
A microprocessor, single-threaded technology, applied in the direction of program synchronization, multi-programming device, resource allocation, etc., can solve the problems of multi-threaded microprocessors being on a par, cannot be applied to single-threaded microprocessor systems, etc., to overcome deadlocks Detect and intervene system shortcomings, save resources, and improve performance
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2006-08-02
- Estimated Expiration
- Not applicable · inactive patent
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention relates to the technical field of microprocessors, in particular to a deadlock detection and intervention method for a typical single-threaded microprocessor system such as a single-chip microcomputer. Background technique
[0002] The thread of a microprocessor refers to the execution process of a program. In a single-threaded microprocessor such as a single-chip microcomputer, a program can only execute one instruction at present. This single-thread microprocessor has been widely used in some portable and remote unattended instrumentation systems because of its small size, powerful functions, low price and convenient development.
[0003] The deadlock described above is generally believed to exist in multi-threaded microprocessors corresponding to single-threaded microprocessors. Each thread in two or more threads is waiting for the other thread to release a certain lock. Commonly used resources are blocked, so that each thread cannot ...
Examples
Embodiment Construction
[0015] figure 1 It is a schematic diagram of the deadlock detection structure of the present invention. In the figure, the data storage device 101 saves the maximum CPU time requirement of each specific task, which can be set in advance or dynamically adjusted during program running. The nth task running 102 of the single-threaded microprocessor indicates that the current task takes up all the time of the CPU, and only when a processor interrupt occurs, the CPU time is temporarily handed over to the interrupt service program for use, and the interrupt service program performs on-site protection and other processing to complete After that, give the CPU time to the current nth task to continue using the CPU time. The microprocessor physical timing resource 103 is an important physical resource of the present invention, works in an interrupt mode, and deprives the CPU usage time of the current task when an interrupt occurs.
[0016] figure 2 It is a flow chart of the task modu...