Metro applications in Windows 8 will receive access to the device’s resources based on one of the three possible states they could be in, Microsoft detailed today in a blog post.One of these would include applications that are actively running in the foreground, and which will have access to CPU, disk, memory, and other resources they need.
This does not change the manner in which applications run on Windows, Sharif Farag and Ben Srour, lead program managers on the Fundamentals and User Experience teams explain in the said post.
When applications are active on the foreground, both in full screen or not, they will act the same as before. However, in Windows 8, this is so only when the screen is on – when the user interacts with the device.
Fast and responsive applications developed today will need to be designed differently than before, especially when it comes to power efficiency. However, these apps will also need to fit new hardware and consumer needs.
“The existing application model needed to evolve in order to yield the power savings and battery life that customers want. Of course, as we keep saying, desktop applications that you currently have will work exactly like they do on Windows 7 today (and were even improved in many dimensions),” the said blog post reads.
“The resources available to compute, the resources required, and the types of computation done are changing, and Windows 8 is providing new facilities to tap into this opportunity.”
One of the main components of a foreground-based approach is concurrency, Microsoft explains. Developers have already been presented with the necessary tools to enable them to create highly concurrent applications.
In the new scenario, apps need no longer be kept running in the background to perform a task, but will be able to leverage the new OS background tasks infrastructure to complete activities in a power-efficient manner even when in the background.
“Background Tasks can be invoked in a number of ways, such as from a push notification, from a timed event, or even from incoming network data. The system is also smart enough to allow apps to run more often in the background when your PC is plugged into the wall,” the post continues.
The battery life of the device is improved significantly, due to the fact that code will run only when necessary, and not at all times. Work will still be done, though in a manner than minimally impacts the system resources.
“On top of improvements to how app code can execute in the background, we’ve made many improvements in the tools infrastructure and WinRT API to make asynchronous programming easier and more powerful,” Microsoft’s employees explain.
Apps running in the foreground will benefit from increased performance, Microsoft explains, adding that the battery life of the device will also be greatly extended.