1. A method for controlling the execution of a first task and a second task over a system in a periodical time frame of M time units, comprising: executing the first task, wherein the first task has a higher priority than the second task; and before the execution of the first task is completed, suspending the execution of the first task in each periodical time frame of M time units, to preserve at least some of system resource for the second task, wherein the first task is executed for a first duration before the execution of the second task, the second task is executed for a second duration and a ratio between the periodical time frame of M time units and the second duration is constant.