Universal timed task management realization method

A timing task and implementation method technology, applied in the direction of program startup/switching, multi-program device, etc., can solve the problems of complex programming and difficulty in ensuring that timing signals are triggered on time, and achieve the effect of simple operation and convenient integration
CN102129393AInactive Publication Date: 2011-07-20NANJING NRIET IND CORP

Patent Information

Authority / Receiving Office
CN ยท China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING NRIET IND CORP
Publication Date
2011-07-20
Estimated Expiration
Not applicable ยท inactive patent

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a universal timed task management realization method, which is characterized by comprising three steps. In the first step, a manager consisting of a synchronous ordered queue, a plurality of generator threads and a plurality of consumer threads is set. In the second step, the queue manager manages different timed tasks by the synchronous ordered queue, sorts the tasks in the queue in an ascending way according to execution time, triggers a notice every time when tasks are added into the queue, and ensures that the order of the queue is unchanged by insertion sort. The third step specifically comprises the following steps of: when the consumer threads are started, checking whether the queue comprises periodical tasks or not; if the queue is checked not to comprise the periodic tasks, blocking the threads, awakening waiting tasks by using the notice when the waiting tasks are inserted and rechecking the queue; if the queue is checked to comprise the periodical tasks, checking whether the tasks are expired, and if the tasks are checked to be expired, calculating expiration dates, starting blocking the threads and waiting for a limited time; rechecking the queue if waiting for the limited time or the waiting tasks are awakened by the notice; executing the expired tasks immediately when the expired tasks are found in the queue checking of each time; and for the periodical tasks, modifying execution starting time after the execution of each time, and inserting the periodical tasks into the queue again for calling and execution. The method has the characteristics of universality and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present invention relates to a method for timing management of configurable tasks in a timing system, especially a method for triggering timing tasks suitable for light-weight applications, in particular a method for implementing general timing task management . Background technique

[0002] As we all know, in the information system, some job tasks need to be executed periodically, and these tasks can be completed by some job schedulers (such as: quartz, cron), such job schedulers periodically execute registered tasks by reading and parsing cron expressions . These schedulers are fully functional, but they are relatively complex and bulky, and are not suitable for some lightweight applications.

[0003] In addition, the operating system also provides a type of timer, which sends a special signal regularly through the underlying signal trigger mechanism, and then the application program executes periodic tasks by capturing the signal. The disadva...

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