Patent ID: 8601488

Claim:
A system provided with a processor that executes processes while switching between a plurality of tasks, the system comprising: a distinguishing unit for identifying a running postponable instruction based on a description of the running postponable instruction; a determination unit for comparing a remaining processing time allocated by an operating system for the running postponable instruction to a preset threshold value, the preset threshold value is set in advance based on a processing time required to execute the running postponable instruction, wherein different threshold values to be set depending on the kinds of postponable instruction; and an executing unit for executing a task switch terminating the running postponable instruction if the remaining processing time allocated by the operating system for the running postponable instruction is less than the preset threshold value, wherein the running postponable instruction is described immediately before a critical section, and is executed before the execution of the critical section, and wherein if the remaining processing time allocated by the operating system for the running postponable instruction has become shorter than the threshold value, the running postponable instruction is not executed, and the running postponable instruction is switched without entering the critical section.