Method for realizing timer

An implementation method and timer technology, applied in the direction of generating/distributing signals, multi-channel program devices, etc., can solve the problems of inconvenient software module overall transplantation, and achieve the effect of convenient transplantation, clear management and high precision

Inactive Publication Date: 2010-06-09
SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF1 Cites 20 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical problem to be solved by the present invention is to provide a timer implementation method in order to overcome the disadvantage that the current software timer is inconvenient for the overall transplantation of software modules

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0023] This example adopts the scheme of the present invention to realize the timer.

[0024] First, the main thread creates a timer queue, initializes the timer queue, generates a head node for managing this queue, and facilitates various operations on this timer queue, such as adding, deleting, clearing, etc., and then the user The thread creates a software timer and initializes the timer parameters. The timer parameters include the timer ID number, the timer timeout time, the remaining time before the timer timeout, the timer linked list pointer, the timer queue synchronization lock mechanism, and the timer timeout operation. event, the main thread creates sub-threads according to the software timer created by the user, initializes the software clock through the hardware clock, completes the registration of the timer in the queue, and performs the locking operation of the queue operation shared lock during this process, and unlocks it after completion , the child thread pat...

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 relates to a timer technique, provides a method for realizing a timer, and solves the problem that a software module is inconvenient to wholly transplant in the conventional software timer. The timer adopts the following technical scheme that: firstly, a main thread creates a timer array and initializes the timer array to generate a head node for managing the array; secondly, a user thread creates a software timer and initializes the timer parameters; thirdly, the main thread creates a secondary thread, initializes a software clock through a hardware clock, finishes the registration of the timer in the array, and performs locking operation on an array operation shared lock; and fourthly, the secondary thread orderly inspects all user-defined timer nodes in the array, and judges whether a value of a counter thereof is 0 or not one by one, if so, executes overtime timer event, otherwise, performs reducing 1 operation on the counter and then returns to the step of orderly inspection by the secondary thread. The method has the advantages of convenience and applicability to the timer.

Description

technical field [0001] The invention relates to timer technology, in particular to software timer technology. Background technique [0002] As we all know, the timer function is extremely important and ubiquitous in software development. Whether it is the development of application software on the computer or the development of embedded products, it is an essential and important module, such as the timer switch in the TV, the playback progress bar display in the player software, etc., are all Timer management is inseparable. In the software development of most products, timer management is realized based on the interface function or system function of the hardware clock. In addition, it is confusing in the management of multiple timer events. Contents of the invention [0003] The technical problem to be solved by the present invention is to provide a timer implementation method in order to overcome the disadvantage that the current software timer is inconvenient for the...

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/46G06F1/04
Inventor 尤金刚
Owner SICHUAN CHANGHONG ELECTRIC CO LTD
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