Patent ID: 8909892

Claim:
A method, comprising: allocating in a memory, by a processor, memory space to store two or more process control blocks for two or more active tasks to be performed by the processor comprising one or more custom functional units having a respective processing state not accessible by the processor, the processor running a real time operating system and one or more application programs including the two or more active tasks; configuring, by the processor, a memory controller to store a first processing state of the one or more custom functional units currently running a first one of the two or more active tasks, in a first one of the two or more process control blocks in the memory, in response to a preemptive task switch requirement of the real time operating system; configuring, by the processor, the memory controller to load a second processing state of the one or more custom functional units for a second one of the two or more active tasks, from a second one of the two or more process control blocks in the memory, in response to the preemptive task switch requirement of the real time operating system; causing the processor to perform the second one of the two or more active tasks, based on the second processing state loaded into the one or more custom functional units; reading, by the processor, a status indication of the one or more custom functional units indicating whether a first processing state of the one or more custom functional units currently running a first one of two or more active tasks, is waiting to be saved in a main memory; causing the first processing state to be copied into a temporary state memory; allowing the one or more custom functional units to continue execution of a second one of the two or more active tasks; and causing the first processing state to be transferred to the main memory from the temporary state memory during background while the one or more custom functional units continue executing the second one of the two or more active tasks.