Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Mutual exclusion semaphore abnormal blocking auxiliary analysis method and system and storage medium

A technology of mutual exclusion signals and auxiliary analysis, applied in the field of multi-threaded programming, can solve problems such as difficult to determine the problem code, and achieve the effect of rapid positioning

Pending Publication Date: 2022-05-10
BEIJING TELIXIN ELECTRONICS TECH
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In addition, the coredump information is sometimes difficult to determine the problem code because the call stack is destroyed

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
  • Mutual exclusion semaphore abnormal blocking auxiliary analysis method and system and storage medium
  • Mutual exclusion semaphore abnormal blocking auxiliary analysis method and system and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] Mutual exclusion semaphores are usually used for access protection of shared resources, and locks are required before access. At this time, other processes are not allowed to access shared resources, and can only be in the pending waiting state. Multiple processes need to queue up to wait for the same semaphore. After accessing shared resources, unlock is required, and other waiting threads can access resources in order.

[0036] Since the use of mutexes must occur in pairs in the same thread, the number of locked times in the normal state is equal to the number of unlocked times. Using this feature, record the information before and after the lock of the semaphore respectively. The information here includes the lock count, thread name, function name, code line number and thread id (note: the lock count must be recorded after the lock). In this way, when blocking occurs, the position of code pending can be judged by observing the record information before the lock.

...

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 mutual exclusion semaphore abnormal blocking auxiliary analysis method and system and a storage medium, and the method comprises the steps: 1, carrying out the lock operation of a corresponding mutual exclusion semaphore when a thread occupies a shared resource, recording wait information before the lock, and adding the wait information into a wait list; step 2, after the lock, recording lock information, and deleting wait information from the wait list at the same time; 3, after the shared resources are accessed, unlock operation is carried out on the semaphore, and then lock information is cleared; 4, each semaphore forms a table record, and the table records are recorded in a memory in real time and recorded in a flash at regular time; and 5, when an exception occurs, determining the semaphore and the code of the problem by checking the table record information. The method has the beneficial effects that the method is used for monitoring the abnormal blocking condition of the semaphore in real time, and meanwhile, problem points can be quickly positioned.

Description

technical field [0001] The invention relates to the technical field of multi-thread programming, in particular to network communication software developed on a ZebOS platform based on an embedded linux kernel. Background technique [0002] In the ZebOS platform, almost all modules are implemented in the form of processes, and the inter-module communication uses the IPC mechanism of inter-process communication, which ensures the safety of the memory used by the modules. The core module HSL needs to deal with the chip and upper-layer applications at the same time, in order to ensure its efficiency, it uses a multi-threaded mode, which can be seen by executing ps–T|grep hsl in the shell. Since all threads in the same process share memory, mutual exclusion of resources must be considered, and the nested use of multiple mutex semaphores can easily lead to deadlock. The Linux kernel provides a semaphore exception tracking mechanism, and the corresponding compilation option needs ...

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/52G06F9/54
CPCG06F9/526G06F9/54
Inventor 许志勇晏元贵祝国胜
Owner BEIJING TELIXIN ELECTRONICS TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products