A low-power idle waiting method in multi-thread mode

A multi-threaded, low-power technology, applied in the waiting field, can solve the problems of inconsistent processing accuracy, reduced system running speed, high usage rate, etc. Effect

Active Publication Date: 2018-04-27
INST OF INFORMATION ENG CHINESE ACAD OF SCI
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The reason why the usleep function is used to deal with the situation that the system has no data packet driver is to ensure the processing accuracy. In the actual system operation process, the requirements for processing accuracy are not uniform. The existing technology uses the usleep function to achieve The idle waiting method cannot be flexibly adjusted according to the processing accuracy requirements, so that the CPU usage rate of the system remains high, which will not only increase the power consumption of the system, but also reduce the operating speed of the system, and cannot keep the system running. a better running state

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
  • A low-power idle waiting method in multi-thread mode
  • A low-power idle waiting method in multi-thread mode

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail in conjunction with the accompanying drawings.

[0026] Such as figure 1 As shown, the low-power idle waiting method in the multi-thread mode of the present invention is a usleep alternative method that can greatly reduce CPU usage and power consumption.

[0027] The main steps of this method are:

[0028] (1) When multiple threads of the system need to enter the waiting state, create an independent timing thread for calling the conditional waiting function provided by the system;

[0029] (2) When a thread needs usleep, judge the calling condition:

[0030] 1) If the precision requirement is high, directly call the usleep function;

[0031] 2) If the waiting time is greater than the set threshold, directly call the usleep function;

[0032] 3) Otherwise, call the conditional waiting function instead, t...

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 present invention provides a low-power idle waiting method in a multi-thread mode, comprising the following steps: 1) When multiple threads of the system need to enter a waiting state, create an independent timing thread for calling a condition provided by the system Waiting function; 2) when an idle thread in the multiple threads needs usleep, judge the calling condition: 3) after the independent timing thread carries out timing for a cycle, judge whether there is a thread waiting to wake up in the multiple threads , if it exists, wake up the aforementioned idle thread; 4) when the process exits, close the timing thread. The present invention increases an independent timing thread when the same program is running in the system, but, because the conditional waiting function is used to replace the usleep function to realize that the idle thread enters the conditional waiting state, it is not necessary to make all threads of the system be in the usleep state, thereby greatly Significantly reduce CPU usage.

Description

technical field [0001] The invention relates to the technical field of electrical communication, in particular to a low-power idle waiting method in a multi-thread mode. Background technique [0002] In recent years, the topic of network security has been mentioned more and more important. When it comes to network security, we have to mention the Deep Packet Inspection (DPI) system, which plays an important role in network security. [0003] In the current high-bandwidth and high-traffic situation, in order to meet actual needs, the system must work with multiple threads. These systems are all driven by packets. Most of the time the system will be running at almost full capacity, but some of the time the system will be running without packet drivers. At this moment, the system needs to use the usleep function to suspend and wait for the arrival of the next packet. But there is a problem with using the usleep function, which will make the CPU in a state of high usage. Th...

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 Patents(China)
IPC IPC(8): G06F1/32
Inventor 郑超郭欢刘庆云李佳杨嵘李舒郭莉
Owner INST OF INFORMATION ENG CHINESE ACAD OF SCI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products