Patent ID: 7784062

Claim:
A method for operating a controller therein a non-preemptive operating system having a number of timers to thereby control a plurality of events greater than the number of said timers, said method comprising: between clock ticks, receiving one or more signals indicating that an event from the plurality of event is inactive, waiting or executing from sensors, switches, executing programs or a combination thereof, wherein the one or more signals that initiate one or more timed events, the timed events including inactive events, active events, pending events, executing events, and waiting events; on or after a clock tick immediately following said receiving of one or more signals, updating entries in an event control block in accordance with said received signal or signals, wherein said entries including a time remaining for pending events, a time past due for active events, a priority of each timed event, and indications of whether events of the plurality of events are inactive, waiting, pending, active, or executing, wherein said updating further includes updating a shadow semaphore within said operating system on a clock tick, and using said shadow semaphore to reprioritize past due events; determining whether any pending event or events have timed out and activating any timed-out events; sending a signal notifying an executing program of an activated event having a highest priority; and increasing priorities of past due active events that have not yet been signaled to the executing program.