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

Timer setting method under multithreading environment

A timer and multi-thread technology, applied in the direction of multi-program devices, etc., can solve the problems that the system time performance is very large, the system space overhead is not large, etc., and the setting method is simple and easy to understand.

Inactive Publication Date: 2013-04-03
PCI TECH GRP CO LTD
View PDF3 Cites 21 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0012] In summary, although the incremental timer setting method based on the timerID index is simple in principle, clear in structure, and has little space overhead for the system, since the overhead of the setTimer operation is O(n), when the number of TCBs is large When the time performance of the system is very large, it is necessary to solve it

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
  • Timer setting method under multithreading environment
  • Timer setting method under multithreading environment
  • Timer setting method under multithreading environment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0043] Embodiment one, see figure 1 .

[0044] The present invention provides a method for setting a timer based on a multi-threaded environment. The setting method includes an index data structure and two doubly linked lists, wherein:

[0045] The index data structure is used to: quickly find the timer unit according to the unique identifier (timerID) of the timer unit;

[0046] The doubly-linked list 1 is used to: connect all timer units in series according to the order of timing triggering, and the overtime value of the timer unit can be recorded in the timer unit in increments; for setting a new timer The insertion position of the new timer can be effectively found at the time; it is convenient for the timer execution thread to regularly scan the timer unit to determine whether the timer unit arranged at the head of the linked list should be triggered to time out; it is convenient for the timer execution thread to regularly update the timer unit The timeout value;

[00...

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 timer setting method under the multithreading environment. On the basis of the traditional increment timer, one index structure and a double linked list are introduced in to improve the time efficiency of the timer. The traditional increment timer adopts one double linked list to manage a timer unit according to a time overtime sequence, and the steps of setting a new timer, clearing the timer and carrying out timer overtime judgment are all carried out by the linked list. When the number of the timer unit is huge, the operations occupy a great quantity of CPU (central processing unit) resources. According to the index structure introduced by the invention, the timer unit can be quickly looked up and managed according to the unique identification of the timer, first timer units triggered at different time periods are connected by the newly-added double linked list, the setting operation performance of the new timer is improved, and the timer time efficiency is improved under the condition that little space overhead is added. The timer setting method under the multithreading environment, which is disclosed by the invention, has the advantage that an implementation method is simple and easy to understand, and is suitable for the requirement on the timer under the common environment.

Description

technical field [0001] The invention relates to the field of computer software, in particular to a method for setting a timer based on a multithreaded operating system environment. Background technique [0002] Timers are often used in software development, especially in the design of communication systems, which have a large number of timing requirements. The program may perform some tasks regularly, or in the process of communication, both the sending and receiving parties need to use timers: after the sender sends a message, sometimes it needs the other party to receive the response from the other party within the agreed time. If there is no response, appropriate processing is required, or the message is resent, or error processing is performed. In many protocols based on network communication, there are many statutes related to timers. To realize these protocols, the realization of timers is one of the most basic requirements. Therefore, timers play a vital role in mod...

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/46
Inventor 田之进梁平宁学军
Owner PCI TECH GRP CO LTD
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