Patent ID: 7784057

Claim:
A method for executing a plurality of tasks by a processor, the method comprising: executing a first task by the processor using a call stack, the first task having an associated first context, and the first context becoming a current context of the processor while the first task is being executed by the processor; detecting, by a supervisor operated by the processor, while the first task is being executed, blocking of the first task; allowing, by the supervisor, in response to said detecting, a context switch switching the current context of the processor from the first context to a second context associated with a second task, including saving a set of register contents and memory locations of the processor related to operation of the first task as a saved task context associated with a worker task before the context switch from the first context to the second context; spawning, by the supervisor, the worker task configured to subsequently complete the first task, the spawning of the worker task being triggered by the detection of the blocking of the first task; switching to execute the second task by the processor using the call stack; detecting that the first task is no longer blocked while executing the second task; allowing the current context to switch from the second context to the saved task context associated with the worker task when the second task has completed a predetermined set of processing steps of the second task; and executing the worker task by the processor using the call stack.