摘要 |
PURPOSE: A method for periodically executing a task by use of flag variables and a semaphore, is provided to reduce delay time through independently operating a periodically timer-interrupting work, and to perform a full load control function of a corresponding system, while repeating a work every specific period according to a load of the system, by operating a corresponding flag variable to control a semaphore count. CONSTITUTION: A method for periodically executing a task by use of flag variables and a semaphore, comprises the steps of: setting up an interrupt period of a timer; confirming whether an end flag is set up, when the timer interrupt is generated; increasing a semaphore count by '1' through calling a semaphore signal function; performing a work responding to a task which waits at the semaphore; decreasing the semaphore count by '1'; when the work is done, setting up the end flag.
|