A method for managing power states of a processor comprising: executing, by the processor, a first power management state machine based on a first urgency level associated with a first task, wherein the first power management state machine specifies three different processor power states and a condition for transitioning between the three different processor power states, wherein each of the three different processor states is configured to operate at a different processor frequency, wherein the different processor frequencies include a first and a second processor frequency, and wherein the condition is a workload for a specific period of time; executing, by the processor, a second task having a second urgency level; in response to determining that the second urgency level is greater than the first urgency level, executing, by the processor, a second power management state machine, wherein the second power management state machine specifies two different processor power states and a condition for transitioning between the two different processor power states, wherein each of the two different processor power states is configured to operate at a different processor frequency, wherein one of the two different processor power states is configured to operate at the second processor frequency, and wherein the condition is a workload for a specific period of time; executing a third power management state machine responsive to completion of the first task, wherein the third power management state machine specifies a processor power state configured to operate at a processor frequency; and executing one of the first or third power management state machines responsive to completion of the second task, wherein the first power management state machine is executed if a further task having the first urgency level is waiting, and wherein the third power management state machine is executed when no further task having the first urgency level is waiting. executing, by the processor, a first power management state machine based on a first urgency level associated with a first task, wherein the first power management state machine specifies three different processor power states and a condition for transitioning between the three different processor power states, wherein each of the three different processor states is configured to operate at a different processor frequency, wherein the different processor frequencies include a first and a second processor frequency, and wherein the condition is a workload for a specific period of time; executing, by the processor, a second task having a second urgency level; in response to determining that the second urgency level is greater than the first urgency level, executing, by the processor, a second power management state machine, wherein the second power management state machine specifies two different processor power states and a condition for transitioning between the two different processor power states, wherein each of the two different processor power states is configured to operate at a different processor frequency, wherein one of the two different processor power states is configured to operate at the second processor frequency, and wherein the condition is a workload for a specific period of time; executing a third power management state machine responsive to completion of the first task, wherein the third power management state machine specifies a processor power state configured to operate at a processor frequency; and executing one of the first or third power management state machines responsive to completion of the second task, wherein the first power management state machine is executed if a further task having the first urgency level is waiting, and wherein the third power management state machine is executed when no further task having the first urgency level is waiting.