Patent ID: 7984446

Claim:
A method of executing a plurality of tasks of different priority values, said method comprising: utilizing preemptive multitasking and cooperative multitasking in execution of said plurality of tasks, wherein each task has a different priority value; before starting any of said plurality of tasks, selecting and starting execution of a first task of said plurality of tasks, wherein said first task has highest priority value and is not dependent on completion of any other of said plurality of tasks; while said first task is executing, receiving a request for a particular waiting period from said first task; for duration of said particular waiting period, suspending execution of said first task; and selecting a next task to execute, wherein said selecting said next task comprises: selecting said next task from said plurality of tasks based on said priority values of said plurality of tasks and based on status designations representative of execution progress of said plurality of tasks, wherein said status designations include executing, waiting, interrupted, completed, and unstarted; starting said selected task and changing status designation of said selected task to an executing task; if said executing task requests a waiting period, suspending said executing task and changing status designation of said executing task to a waiting task and repeating said selecting said next task and said starting said selected task; if said waiting period elapses for any waiting task and said executing task has a higher priority value than said waiting task, changing status designation of said waiting task to an interrupted task while allowing said executing task to continue execution; if said waiting period elapses for any waiting task and said executing task does not have a higher priority value than said waiting task, suspending said executing task and changing status designation of said executing task to an interrupted task and repeating said selecting said next task and said starting said selected task; and if said executing task completes execution, changing status designation of said executing task to a completed task and repeating said selecting said next task and said starting said selected task.