Background task resource control

Among other things, one or more techniques and/or systems are provided for controlling resource access for background tasks. For example, a background task created by an application may utilize a resource (e.g., CPU cycles, bandwidth usage, etc.) by consuming resource allotment units from an application resource pool. Once the application resource pool is exhausted, the background task is generally restricted from utilizing the resource. However, the background task may also utilize global resource allotment units from a global resource pool shared by a plurality of applications to access the resource. Once the global resource pool is exhausted, unless the background task is a guaranteed background task which can consume resources regardless of resource allotment states of resource pools, the background task may be restricted from utilizing the resource until global resource allotment units within the global resource pool and/or resource allotment units within the application resource pool are replenished.

BACKGROUND

Many computing environments may allow applications to execute background tasks to perform various tasks (e.g., an email application may execute a background task to check for new email; a phone application may execute a background task to receive incoming phone calls while a mobile phone hosting the phone application is in a suspended state; etc.). Unfortunately, background tasks may impact power consumption and battery life because the background tasks may consume resources, such as CPU processing power and/or network bandwidth. Additionally, background tasks may impact a user's experience with a foreground application (e.g., an application visible to a user and/or interacted with by the user) because resource usage by the foreground application may be interrupted by background tasks. Thus, allowing background tasks unfettered access to resources may result in reduced battery life and/or user experience. However, restricting execution of background tasks (e.g., background tasks of suspended applications) may also result in a reduced user experience because various (desired) tasks (e.g., email updates) may not be performed (e.g., when a user “awakens” a tablet device, an email application may comprise stale email information because the email application may have been restricted from executing a background task to check for new emails while the tablet device was “asleep”, similarly real-time communication applications, such as VoIP, SMS, and instant messages, may miss and/or be unresponsive to real-time message events while the tablet device was “asleep”).

SUMMARY

Among other things, one or more systems and/or techniques for controlling resource access and/or usage for background tasks are disclosed herein. A computing environment may allow an application to create a background task. For example, a background application (e.g., an application not visible to a user and/or not currently being interacted with by the user), a suspended application (e.g., an application suspended based upon power consumption considerations of a host computing device), and/or other applications may create a background task to perform one or more tasks. In one example, the application may be classified as a first class application, a second class application, and/or other classifications. A first class application (e.g., operating system applications, control panel applications, user designated applications, etc.) may be regarded as higher priority than a second class application (e.g., a third party application), and thus first class background tasks of the first class application may be provided with a higher level of service (e.g., additional resource access) than second class background tasks of the second class application.

An application resource pool (e.g., an allotment of a quota) may be associated with an application. The application resource pool may be configured to comprise resource allotment units (e.g., units representing CPU processing cycles, network bandwidth usage, etc.). The application resource pool may be initialized by assigning an initial resource allotment comprising resource allotment units to the application resource pool. A background task of the application may be allowed to utilize a resource (e.g., CPU processing power, network bandwidth, etc.) by consuming resource allotment units from the application resource pool. Upon exhaustion of the application resource pool, the background task may be restricted from utilizing the resource via the application resource pool. A replenishment event (e.g., a periodic time source or external signal) may be associated with the application resource pool. Upon raising/occurrence of the replenishment event, a replenishment resource allotment comprising resource allotment units may be assigned to the application resource pool without surpassing a maximum value of resource allotment units for the application resource pool. In one example, the replenishment event may be implemented using a replenishment timer. The replenishment timer and/or the maximum value for the application resource pool may be a function of whether the application is a first class application (e.g., shorter replenishment timer and/or larger maximum value) or a second class application (e.g., longer replenishment timer and/or smaller maximum value). The replenishment timer and/or the maximum value for the application resource pool may be adjusted based upon a battery state or particular standby battery time goal of a device hosting one or more applications, for example. It may be appreciated that a replenishment timer is merely one example of a replenishment event, and that other manners for determining when to replenish an application resource pool and/or a global resource pool are contemplated herein.

A global resource pool comprising global resource allotment units may be maintained for a plurality of applications. A background task may be allowed to consume (e.g., “steal”) global resource allotment units from the global resource pool once the application resource pool becomes exhausted. That is, upon exhaustion of the application resource pool, the background task may be allowed to utilize the resource by consuming global resource allotment units from the global resource pool. In one example, the background task may be allowed to consume a number of global resource allotment units corresponding to the maximum value of resource allotment units for the application resource pool per consumption request, which may restrict the background task from unfairly over consuming (e.g., “hogging”) global resource allotment units that may be shared with other applications. Other policies may be introduced to improve availability of the global resource pool to all background applications, such as reducing the allocation unit between successive attempts. Upon exhaustion of the global resource pool, the background task may be restricted from utilizing the resource via the global resource pool.

Nevertheless, where the global resource pool becomes exhausted, the background task may still be allowed to utilize a resource because the background task comprises a guaranteed background task (e.g., a phone application of a smart phone may be allowed to execute a receive phone call background task regardless of whether resource allotment units are available). It may be appreciated that in one example, a guaranteed background task may comprise a “critical” task. In one example, the guaranteed background task may be allowed to charge the global resource pool into a negative global resource allotment state. In another example, the application resource pool and/or global resource pool may be replenished for the guaranteed background task.

A global replenishment timer may be associated with the global resource pool. Upon expiration of the global replenishment timer, a global replenishment resource allotment comprising global resource allotment units may be assigned to the global resource pool without surpassing a maximum value of global resource allotment units for the global resource pool. The global replenishment timer and/or the maximum value for the global resource pool may be adjusted based upon a current functioning mode of the device (e.g., AC, DC, DC screen ON, etc.) hosting the application, for example.

It may be appreciated that the global resource pool may be implemented in a variety of ways (e.g., to selectively accommodate occasional bursts of activity). In one example, when the device is relying on battery power, the global resource pool may be replenished merely from unused allotment units. When the device is using AC power and/or is within a discrete state (e.g., an amount of power consumed by background tasks relative to system power consumption is minimal, such as below a threshold percentage), then the global resource pool may be replenished with additional resources (e.g., allotment units), which may allow for additional background task activity. When the device transitions between operation states (e.g., DC to AC, AC to DC, Screen On, Screen Off, etc.), the global resource pool may be resized based upon a current battery state of the device, for example.

In one example of implementing a global resource pool, a first class global resource pool may be maintained for first class applications (e.g., a first class background task may utilize a resource by consuming from the first class global resource pool after exhaustion of an application resource pool). In another example, a second class global resource pool may be maintained for second class applications (e.g., a second class background task may utilize a resource by consuming from the second class global resource pool after exhaustion of an application resource pool). The second class global pool may also be maintained for first class applications, such that a first class background task may utilize a resource by consuming from the second class global resource pool after exhaustion of the first class global resource pool (e.g., but a second class background task may not be allowed to consume from a first class global resource pool).

Selectively allowing and/or restricting background tasks from utilizing resources may improve power consumption, battery life, and/or user experience, while maintaining functionality provided by the background tasks.

DETAILED DESCRIPTION

Many computing environments may implement power conservation techniques to mitigate power consumption, conserve battery life, and/or improve performance of foreground applications. In one example, an operating system may provide a suspend policy that may inhibit the execution of a suspended application that may otherwise invoke computing resources to perform power consuming tasks. In this way, the suspended application may be unable to execute background tasks. Unfortunately, suspended applications may be unable to perform desired functionality (e.g., a suspended email application may be unable to periodically check for email while suspended, which may result in the email application providing stale email information upon resumption). In another example, the operating system may lack adequate resource management policies for background applications (e.g., applications not visible to a user and/or interacted with by the user), which may allow the background applications to execute background tasks to perform power consuming tasks that may reduce battery life and/or reduce performance of foreground applications.

Accordingly, among other things, one or more systems and/or techniques for controlling resource access for background tasks are provided herein. In particular, an application resource pool configured to comprise resource allotment units (e.g., units representing CPU processing cycles, network bandwidth, etc.) may be maintained for an application. A background task of the application may utilize a resource, such as a CPU, by consuming the resource allotment units. Upon exhaustion of the application resource pool, the background task may be restricted from utilizing the resource. This can be achieved by, for example, returning the application to the suspended state. A replenishment timer may be maintained for the application resource pool, such that a replenishment resource allotment comprising resource allotment units may be assigned to the application resource pool upon expiration of the replenishment timer. A global resource pool comprising global resource allotment units may be maintained for a plurality of applications. For example, if the application resource pool is exhausted, then the background task may utilize the resource by consuming global resource allotment units from the global resource pool. Upon exhaustion of the global resource pool, the background task may be restricted from utilizing the resource. A global replenishment timer may be maintained for the global resource pool, such that a global replenishment resource allotment comprising global resource allotment units may be assigned to the global resource pool upon expiration of the global replenishment timer. In this way, background tasks may be selectively allowed and/or restricted from utilizing resources based upon application resource pools and/or global resource pools, which may improve power conservation, battery life, and/or foreground application execution, for example.

One embodiment of controlling resource access for background tasks is illustrated by an exemplary method100inFIG. 1. At102, the method starts. A computing environment may allow an application to create background tasks to perform various tasks (e.g., an email application may create a background task to check for new emails). Instead of merely allowing or denying execution of the background tasks, resource access control may be implemented. In one example of implementing resource access control, an application resource pool for an application may be initialized and/or maintained. In particular, an initial resource allotment comprising resource allotment units may be assigned to the application resource pool associated with the application, at104. For example, an initial resource allotment of 2 seconds (e.g., representing 2 seconds of CPU processing cycles) may be assigned to an application resource pool associated with an email application. At106, a background task of the application may be allowed to utilize a resource by consuming resource allotment units from the application resource pool. For example, the email application may create an email update background task that may consume CPU processing cycles by consuming time units from the 2 seconds assigned to the application resource pool (e.g., 0.03 seconds of processing cycles may be utilized when the email update background task initially checks for new emails, thus leaving 1.97 seconds remaining within the application resource pool after the initial check).

At108, upon exhaustion of the application resource pool (e.g., 0 seconds remaining), the background task may be restricted from utilizing the resource via the application resource pool. In this way, the background task may be restricted from over consuming resources via the application resource pool until replenishment of the application resource pool, which may reduce power consumption and/or improve foreground application performance by freeing up resources.

A replenishment timer may be maintained for the application resource pool (e.g., a 15 minute timer). Upon expiration of the replenishment timer, a replenishment resource allotment comprising resource allotment units (e.g., 2 seconds) may be assigned to the application resource pool (e.g., the application resource pool may be replenished to 2 seconds). In one example, the application resource pool may be limited by a maximum value of resource allotment units, such that the replenishment resource allotment may not replenish the application resource pool above the maximum value (e.g., if the replenishment timer has expired but the application resource pool is not yet empty and instead still comprises 1.5 seconds, then the replenishment resource allotment may merely assign 0.5 seconds even though 2 seconds are available for the replenishment resource allotment to assign). If a surplus of resource allotment units results from replenishment of the application resource pool, then the surplus of resource allotment units may be assigned to a global resource pool associated with a plurality of applications (e.g., if the application resource pool comprises 1.5 seconds, then the replenishment resource allotment may assign 0.5 seconds, which may result in a surplus of 1.5 seconds that may be assigned to a global resource pool). In one example, the replenishment timer may be adjusted based upon a battery state of a device within which the background task is executing (e.g., the replenishment timer may be lengthened as the amount of battery charge diminishes so that the application resource pool is replenished less frequently, the replenishment timer may be shortened when the device is connected to AC power so that the application resource pool is replenished more frequently, etc.). Similarly, the maximum value of resource allotment units may be based upon a battery state of the device (e.g., the maximum value may be decreased as a battery charge of the device decreases; the maximum value may be increased when the device is connected to AC power; etc.).

A global resource pool comprising global resource allotment units may be maintained for a plurality of applications (e.g., 30 seconds may be initially assigned to the global resource pool). Applications may be allowed to consume (e.g., “steal”) global resource allotment units from the global resource pool in order to utilize a resource. In one example, upon exhaustion of the application resource pool (e.g., 0 seconds remaining), the background task may be allowed to access the resource (e.g., one or more resources) by consuming global resource allotment units from the global resource pool. The background task may be allowed to consume, per consumption request, a number of global resource allotment units corresponding to the maximum value of resource allotment units for the application resource pool. For example, the email update background task may be allowed to consume (e.g., “steal”) global resource allotment units from the global resource pool in 2 second chunks based upon the application resource pool of the email application comprising the maximum value of 2 seconds.

Upon exhaustion of the global resource pool (e.g., 0 seconds remaining), the background task may be restricted from utilizing the resource (e.g., one or more resources) via the global resource pool. In one example, if the background application comprises a guaranteed background task (e.g., a background task guaranteed to execute), then the background task may utilize the resource by charging the global resource pool into a negative global resource allotment state at least one time (e.g., subsequent requests may be denied to conserve battery). For example, the email update background task may charge the exhausted global resource pool for 1.5 seconds, thus placing the global resource pool into a negative 1.5 global resource allotment state. In one example, the negative global resource allotment state may be held against the global resource pool during a subsequent replenishment. For example, a global replenishment resource allotment of 30 seconds may merely place the global resource pool at 28.5 seconds. As another example, unused quota from applications (e.g., application resource pools) can be used to reduce the “debt” of a negative global resource pool. Thus, while the ability to service guaranteed tasks with the minimum unit of quota is honored, non-critical tasks cannot use the global resource pool until the “borrowed” amount has been returned.

A global replenishment timer may be maintained for the global resource pool (e.g., a 40 minute timer). Upon expiration of the global replenishment timer, a global replenishment resource allotment comprising global resource allotment units may be assigned to the global resource pool (e.g., the global resource pool may be replenished with 30 seconds). In one example, the global resource pool may be limited by a maximum value of global resource allotment units, such that the global replenishment resource allotment may not replenish the global resource pool above the maximum value (e.g., if the global replenishment timer has expired but the global resource pool is not yet empty and instead still comprises 10 seconds, then the global replenishment resource allotment may merely assign 20 seconds even though 30 seconds are available for the global replenishment resource allotment). In one example, the maximum value of global resource allotment units for the global resource pool may be adjusted based upon a battery state of the device within which the background task is executing (e.g., the maximum value may be decreased as a battery charge of the device decreases; the maximum value may be increased when the device is connected to AC power; etc.). The global replenishment timer may be adjusted based upon the battery state of the device (e.g., the global replenishment timer may be lengthened as the battery charge of the device decreases; the global replenishment timer may be shortened when the device is connected to AC power; etc.). In another example, the refill rate may be modified based on the state of the device. For example, on DC, there may be no automatic refill rate other than unused quota from applications. On AC however, where the marginal power draw of background tasks compared to the battery refill and/or screen rate is low, this refill rate may be increased significantly. The global resource pool size can be rescaled to reflect actual battery capacity any time the operating mode of the system, and/or refill rate of the pool, changes.

Applications may be classified, and may be provided various levels of service (e.g., varying levels of resource access) based upon such classifications. For example, particular applications may be classified as first class applications (e.g., operating system applications, control panel applications, user designated applications, etc.), while other applications may be classified as second class applications (e.g., third party applications, non-system applications, user designated applications, etc.). It may be appreciated that various classification schemes may be utilized, and are not limited to merely first class and second class classification. In one example of providing varying level of service, the replenishment timer may be adjusted based upon whether the application is a first class application or a second class application (e.g., a replenishment timer may be shortened for a first class application so that the application resource pool is replenished more frequently, and may be lengthened for a second class application). In another example of providing varying level of service, the maximum value of resource allotment units for the application resource pool may be a function of whether the application is a first class application or a second class application (e.g., an application resource pool for a first class application may have a larger maximum value than an application resource pool for a second class application).

In another example of providing varying level of service, multiple global resource pools may be maintained based upon various classifications. For example, a first class global resource pool associated with plurality of first class applications and a second class global resource pool associated with a plurality of second class applications may be maintained. First class applications may be allowed to consume from the first class global resource pool and/or may be allowed to consume from the second class global resource pool. For example, upon a first class background task of a first class application exhausting a first class application resource pool, the first class background task may be allowed to utilize a resource by consuming (e.g., “stealing”) global resource allotment units from the first class global resource pool. Upon the first class background task exhausting the first class global resource pool, the first class background task may be allowed to utilize the resource by consuming (e.g., “stealing”) global resource allotments units from the second class global resource pool.

Second class applications may be allowed to access the second class global resource pool, but may be restricted from accessing the first class global resource pool. For example, upon a second class background task of a second class application exhausting a second class application resource pool, the second class background task may be allowed to utilize a resource by consuming (e.g., “stealing”) global resource allotment units from the second class global resource pool. However, upon exhaustion of the second class global resource pool, the second class background task may be restricted from utilizing the resource (e.g., and may be restricted from “stealing” from the first class global resource pool).

The first class global resource pool and the second class global resource pool may have similar or different configurations. In one example of differing configurations, the first class global resource pool may be assigned a first maximum value of global resource allotment units greater than a second maximum value of global resource allotment units for the second class global resource pool. In another example, a first class replenishment timer of the first class global resource pool may comprise a first replenishment time span smaller than a second replenishment time span of a second class replenishment timer of the second class global resource pool (e.g., the first class global resource pool may be replenished more frequently than the second class global resource pool).

In one example, the application may be in a suspended state (e.g., due to the application being in a background state not visible to a user; due to the device being placed into low power consumption state; etc.). Accordingly, resource access for background tasks of the application may be controlled (e.g., utilizing the application resource pool, global resource pool, etc.). If the application transitions from the suspended state to an execution state (e.g., the user brings the application into the foreground), background tasks of the application may be unrestricted from accessing resources. In this way, the user may interact with the application without undue hindrance because the application may be allowed unrestricted access to resources. A state of the application resource pool may be saved when the application transitions into the execution state so that the application resource pool may be restored to the prior state when the application transitions back into the suspended state. It may be appreciated that foreground tasks (e.g., application in an active execution state, such that tasks are in the foreground and visible) are generally not tightly coupled with background tasks. Tasks can generally complete more quickly (e.g., such as receive emails) when an application is in an active execution state, which is consistent with expectations of a user actively using the application. Also, due to refill rate modulation, if a user is actively using the device, tasks will complete more quickly in a screen on state, even if the user switches to a different application. At110, the method ends.

FIG. 2illustrates an example of a system200configured for controlling resource access for background tasks. The system200may comprise a resource allocation component212. The resource allocation component212may maintain an application resource pool202associated with an application220and/or may maintain a global resource pool204associated with a plurality of applications. For example, the resource allocation component212may initialize the application resource pool202by assigning an initial resource allotment comprising resource allotment units to the application resource pool202(e.g.,500resource allotment units may be assigned). Similarly, the resource allocation component212may assign global resource allotment units to the global resource pool204(e.g., 3000 global resource allotment units may be assigned).

The resource allocation component212may be configured to allow (e.g., allow/restrict218) a background task222of the application220to utilize224a resource226by consuming206resource allotment units from the application resource pool202(e.g., based upon a utilization request216from the background task222). Upon exhaustion of the application resource pool202, the resource allocation component212may restrict (e.g., allow/restrict218) the background task22from utilizing224the resource226via the application resource pool202. However, in one example, the resource allocation component212may allow (e.g., allow/restrict218) the background task222to utilize224the resource226by consuming208global resource allotment units from the global resource pool204once the application resource pool202is exhausted (e.g., the background task222may be allowed to consume208500 global resource units per consumption based upon the application resource pool202having a maximum value of 500 resource allotment units). In another example, the resource allocation component212may transfer global resource allotment units from the global resource pool204to the application resource pool202as resource allotment units. Upon exhaustion of the global resource pool204, the resource allocation component212may restrict (e.g., allow/restrict218) the background task222from utilizing224the resource226unless the background task222comprises a guaranteed background task. The guaranteed background task may be allowed to utilize224the resource226by charging the global resource pool204into a negative global resource allotment state (e.g., negative 500 (or more) global resource allotment units).

The resource allocation component212may maintain a replenishment timer210for the application resource pool202. Upon expiration of the replenishment timer210, the resource allocation component212may assign a replenishment resource allotment comprising resource allotment units to the application resource pool202without surpassing a maximum value of resource allotment units (e.g., 500 resource allotment units) for the application resource pool202. For example, upon expiration of the replenishment timer210(e.g., prior to the application resource pool202becoming exhausted), 300 resource allotment units may be assigned to the application resource pool202so that the application resource pool202may comprise 500 resource allotment units. The surplus of 200 resource allotment units may be assigned to the global resource pool204, for example.

The resource allocation component212may maintain a global replenishment timer214for the global resource pool204. Upon expiration of the global replenishment timer214, the resource allocation component212may assign a global replenishment resource allotment comprising global resource allotment units to the global resource pool204without surpassing a maximum value of resource allotment units (e.g., 3000 resource allotment units) for the global resource pool204. For example, upon expiration of the global replenishment timer214(e.g., prior to the global resource pool204becoming exhausted), 2200 global resource allotment units may be assigned to the global resource pool204so that the global resource pool204comprises 3000 resource allotment units. The surplus of 800 global resource allotment units may be discarded, for example.

FIG. 3illustrates an example300of maintaining a global resource pool and one or more application resource pools. A resource allocation component302may be configured to maintain an application resource pool (A)304for an application (A), an application resource pool (B)310for an application (B), an application resource pool (C)316for an application (C), and/or a global resource pool322for applications (A), (B), and/or (C), for example.

In one example, the resource allocation component302may initialize the application resource pool (A)304for the application (A). The resource allocation component302may assign an initial resource allotment308of 500 resource allotment units to the application resource pool (A)304. The resource allocation component302may initialize a replenishment timer306for the application resource pool (A)304(e.g., the replenishment timer306may be assigned a 3 minute timer). In this way, a background task of application (A) may utilize a resource via the application resource pool (A)304by consuming resource allotment units. For example, a resource allotment unit may represent a CPU processing cycle, a tenth of a second of network bandwidth, and/or other various resource units. The background task of application (A) may consume 10 resource allocation units in order to utilize 10 CPU processing cycles, a second of network bandwidth, and/or other resource units.

The resource allocation component302may maintain the application resource pool (B)310for the application (B). The application resource pool (B)310may be in an exhausted state because application (B) may have consumed the 500 resource allotment units assigned to the application resource pool (B)310. Thus, a background task of application (B) may be restricted314from utilizing a resource via application resource pool (B)310because application resource pool (B) comprises 0 resource allotment units. However, the background task of application (B) may attempt to utilize the resource via the global resource pool322. The resource allocation component302may replenish the application resource pool (B)310upon expiration of a replenishment timer312associated with the application resource pool (B)310. For example, after the expiration of 1 minute, 500 resource allotment units may be assigned to the application resource pool (B)310. In one example, leftover resource allotment units may or may not be returned into the global resource pool322based upon a state of a device (e.g., if using DC power, then leftover resource allotment units may be returned to the global resource pool322because no automatic replenishment may be implemented; if using AC power, then the global resource pool322may be automatically replenished, and thus the leftover resource allotment units may not be returned).

The resource allocation component302may maintain the application resource pool (C)316for the application (C). The resource allocation component302may replenish320the application resource pool (C)316upon expiration of a replenishment timer318associated with the application resource pool (C)316. For example, 500 resource allotment units may be available to replenish320the application resource pool (C)316. However, the application resource pool (C)316may comprise 60 resource allotment units. Thus, the replenishment of the application resource pool (C)316may result in a surplus of 60 resource allotment units because the application resource pool (C)316may be limited to a maximum value of 500 resource allocation units. In one example, the surplus may be assigned326to the global resource pool322.

The resource allocation component302may maintain the global resource pool322for applications (A), (B), and/or (C). For example, background tasks of applications (A), (B), and/or (C) may utilize a resource by consuming global resource allotment units from the global resource pool322based upon exhaustion of corresponding application resources pools (e.g., a background task of application (B) may consume global resource allotment units from the global resource pool in (a maximum of) 500 unit chunks based upon the application resource pool (B) being in an exhausted state). A global replenishment timer324may be maintained for the global resource pool322, such that the global resource pool322may be replenished (e.g., up to a maximum) upon expiration of the global replenishment timer324.

FIG. 4illustrates an example400of a first class application resource pool404and a second class application resource pool408. A resource allocation component402may be configured to maintain the first class application resource pool404for a first class application412. For example, a first class background task414of the first class application412may utilize a resource based upon consuming resource allotment units from the first class application resource pool404. The resource allocation component402may be configured to maintain the second class application resource pool408for a second class application416. For example, a second class background task418of the second class application416may utilize a resource based upon consuming resource allotment units from the second class application resource pool408.

It may be appreciated that the resource allocation component402may maintain the first class application resource pool404and the second class application resource pool408similarly or differently. In one example of maintaining the application resource pools differently, the first class application resource pool404may be assigned a maximum value of resource allotment units (e.g., 500 resource allotment units) that is greater than a maximum value of resource allotment units assigned to the second class application resource pool408(e.g., 200 resource allotment units). In another example, a first class replenishment timer406of the first class application resource pool404may be assigned a replenishment time span (e.g., a 2 minute timer until replenishment) that is shorter than a replenishment time span assigned to a second class replenishment timer410of the second class application resource pool408(e.g., an 8 minute timer until replenishment). In this way, the first class background task414may receive a higher level of service (e.g., increased resource access based upon the larger maximum value and the shorter replenishment time span) than the second class background task418.

FIG. 5illustrates an example500of a first class background task518of a first class application516utilizing a resource based upon consuming global resource allotment units from a first class global resource pool506. A resource allocation component502may be configured to maintain a first class application resource pool504for the first class application516. The resource allocation component502may be configured to maintain the first class global resource pool506for first class applications (e.g., the first class application516and/or other first class applications not illustrated).

The first class background task518may attempt to utilize a resource (e.g., utilization request512) by consuming resource allotment units from the first class application resource pool504. However, the resource allocation component502may restrict the first class background task518from utilizing the resource via the first class application resource pool504based upon the first class application resource pool being exhausted508. In one example, because the first class application resource pool504is exhausted508, the resource allocation component502may allow the first class background task518to utilize the resource by consuming510global resource allotment units from the first class global resource pool506(e.g., allow utilization514). The resource allocation component502may allow the first class background task518to consume510global resource allotment units in 500 unit chunks (e.g., based upon a maximum value of 500 resource allotment units for the first class application resource pool504). In another example, the resource allocation component502may transfer global resource allotment units from the first class global resource pool506to the first class application resource pool504as resource allotment units. For example, the resource allocation component502may transfer 500 unit chunks.

FIG. 6illustrates an example600of a first class background task622of a first class application620utilizing a resource based upon consuming global resource allotment units from a second class global resource pool606. A resource allocation component614may be configured to maintain a first class application resource pool602for the first class application620. The resource allocation component614may be configured to maintain a first class global resource pool604for first class applications (e.g., the first class application620and/or other first class applications not illustrated). The resource allocation component614may be configured to maintain the second class global resource pool606for second class applications (e.g., second class applications not illustrated).

The first class background task622may attempt to utilize a resource (e.g., utilization request616) by consuming resource allotment units from the first class application resource pool602. However, the resource allocation component614may restrict the first class background task622from utilizing the resource via the first class application resource pool602because the first class application resource pool602is exhausted608. Because the first class application resource pool602is exhausted608, the resource allocation component614may allow the first class background task622to utilize the resource by consuming global resource allotment units from the first class global resource pool604(e.g., if global resource allotment units are available for consumption). However, the resource allocation component614may restrict the first class background task622from utilizing the resource via the first class global resource pool604because the first class global resource pool604is exhausted610. In one example, because the first class global resource pool604is exhausted610, the resource allocation component614may allow the first class background task622to utilize the resource by consuming612global resource allotment units from the second class global resource pool606(e.g., allow utilization618). The resource allocation component614may allow the first class background task622to consume612global resource allotment units in 500 unit chunks (e.g., based upon a maximum value of 500 resource allotment units for the first class application resource pool602). In another example, the resource allocation component614may transfer global resource allotment units from the second class global resource pool606to the first class global resource pool604, which may be further transferred from the first class global resource pool604to the first class application resource pool602. For example, the resource allocation component614may transfer 500 unit chunks.

FIG. 7illustrates an example700of a second class background task722of a second class application720utilizing a resource based upon consuming global resource allotment units from a second class global resource pool706. A resource allocation component714may be configured to maintain a second class application resource pool702for the second class application720. The resource allocation component714may be configured to maintain a first class global resource pool704for first class applications (e.g., one or more first class applications not illustrated). The resource allocation component714may be configured to maintain the second class global resource pool706for second class applications (e.g., second class application720and/or other second class applications not illustrated).

The second class background task722may attempt to utilize a resource (e.g., utilization request716) by consuming resource allotment units from the second class application resource pool702. However, the resource allocation component714may restrict the second class background task722from utilizing the resource via the second class application resource pool702because the second class application resource pool702is exhausted708. In one example, the second class background task722may be restricted710from consuming global resource allotment units from the first class global resource pool704because the second class background task722is not a first class background task. Because the second class application resource pool702is exhausted708, the resource allocation component714may allow the second class background task722to utilize the resource by consuming712global resource allotment units from the second class global resource pool706(e.g., allow utilization718). The resource allocation component714may allow the second class background task722to consume712global resource allotment units in 200 unit chunks (e.g., based upon a maximum value of 200 resource allotment units for the second class application resource pool702).

FIG. 8illustrates an example800of a second class background task822of a second class application820being restricted818from utilizing a resource. A resource allocation component814may be configured to maintain a second class application resource pool802for the second class application820. The resource allocation component814may be configured to maintain a first class global resource pool804for first class applications (e.g., one or more first class applications not illustrated). The resource allocation component814may be configured to maintain a second class global resource pool806for second class applications (e.g., second class application820and/or other second class applications not illustrated).

The second class background task822may attempt to utilize a resource (e.g., utilization request816) by consuming resource allotment units from the second class application resource pool802. However, the resource allocation component814may restrict the second class background task822from utilizing the resource via the second class application resource pool802because the second class application resource pool802is exhausted808. In one example, the second class background task822may be restricted810from consuming global resource allotment units from the first class global resource pool804because the second class background task822is not a first class background task. Because the second class application resource pool802is exhausted808, the resource allocation component814may allow the second class background task822to utilize the resource by consuming global resource allotment units from the second class global resource pool806(e.g., if global resource allotment units are available for consumption). However, the resource allocation component814may restrict818the second class background task822from utilizing the resource via the second class global resource pool806because the second class global resource pool806is exhausted812. It may be appreciated that additional and/or alternative techniques may be implemented to improve foreground responsiveness, such as a decay usage CPU scheduling algorithm, for example. Such an algorithm may, for example, restrict a background task from continuously consuming available background CPU time. The algorithm may bias background task activity to be statistically less important than other activity executing by the system. For example, a background task may be restricted from preempting a user foreground activity and/or may be preempted by the user foreground activity.

Still another embodiment involves a computer-readable medium comprising processor-executable instructions configured to implement one or more of the techniques presented herein. An exemplary computer-readable medium that may be devised in these ways is illustrated inFIG. 9, wherein the implementation900comprises a computer-readable medium916(e.g., a CD-R, DVD-R, or a platter of a hard disk drive), on which is encoded computer-readable data914. This computer-readable data914in turn comprises a set of computer instructions912configured to operate according to one or more of the principles set forth herein. In one such embodiment900, the processor-executable computer instructions912may be configured to perform a method910, such as at least some of the exemplary method100ofFIG. 1, for example. In another such embodiment, the processor-executable instructions912may be configured to implement a system, such as at least some of the exemplary system200ofFIG. 2, for example. Many such computer-readable media may be devised by those of ordinary skill in the art that are configured to operate in accordance with the techniques presented herein.

FIG. 10illustrates an example of a system1010comprising a computing device1012configured to implement one or more embodiments provided herein. In one configuration, computing device1012includes at least one processing unit1016and memory1018. Depending on the exact configuration and type of computing device, memory1018may be volatile (such as RAM, for example), non-volatile (such as ROM, flash memory, etc., for example) or some combination of the two. This configuration is illustrated inFIG. 10by dashed line1014.

In other embodiments, device1012may include additional features and/or functionality. For example, device1012may also include additional storage (e.g., removable and/or non-removable) including, but not limited to, magnetic storage, optical storage, and the like. Such additional storage is illustrated inFIG. 10by storage1020. In one embodiment, computer readable instructions to implement one or more embodiments provided herein may be in storage1020. Storage1020may also store other computer readable instructions to implement an operating system, an application program, and the like. Computer readable instructions may be loaded in memory1018for execution by processing unit1016, for example.

Device1012may also include communication connection(s)1026that allows device1012to communicate with other devices. Communication connection(s)1026may include, but is not limited to, a modem, a Network Interface Card (NIC), an integrated network interface, a radio frequency transmitter/receiver, an infrared port, a USB connection, or other interfaces for connecting computing device1012to other computing devices. Communication connection(s)1026may include a wired connection or a wireless connection. Communication connection(s)1026may transmit and/or receive communication media.

Device1012may include input device(s)1024such as keyboard, mouse, pen, voice input device, touch input device, infrared cameras, video input devices, and/or any other input device. Output device(s)1022such as one or more displays, speakers, printers, and/or any other output device may also be included in device1012. Input device(s)1024and output device(s)1022may be connected to device1012via a wired connection, wireless connection, or any combination thereof. In one embodiment, an input device or an output device from another computing device may be used as input device(s)1024or output device(s)1022for computing device1012.

Components of computing device1012may be connected by various interconnects, such as a bus. Such interconnects may include a Peripheral Component Interconnect (PCI), such as PCI Express, a Universal Serial Bus (USB), firewire (IEEE 1394), an optical bus structure, and the like. In another embodiment, components of computing device1012may be interconnected by a network. For example, memory1018may be comprised of multiple physical memory units located in different physical locations interconnected by a network.

Those skilled in the art will realize that storage devices utilized to store computer readable instructions may be distributed across a network. For example, a computing device1030accessible via a network1028may store computer readable instructions to implement one or more embodiments provided herein. Computing device1012may access computing device1030and download a part or all of the computer readable instructions for execution. Alternatively, computing device1012may download pieces of the computer readable instructions, as needed, or some instructions may be executed at computing device1012and some at computing device1030.