PC19
Oct 30th, 2008
Windows 7: Designing Efficient Background Processes
Optimizations and Improvements for Efficient Background Processes in Windows 7

Speaker

Vikram Singh, Program Manager
This session started by presenting an overview on the right model of services, tasks, and background processes in Windows 7. It presentedthe Windows 7 Trigger-Start Services and concluded with security and performance recommendations. / Mentioned Technologies
  • Windows 7
  • Win32

Background activity or processes were defined as system activity not directly initiated by the user. For example, services, scheduled tasks, COM processes and services, and WMI providers. In practical terms, some examples of background activities are search indexing and application fetching. Windows 7 considers the impact of background activity and processes with regards to:
  • Performance
  • Reliability
  • Security
  • Power Consumption
For Windows 7, an internal evaluation of 49 Windows Services was conducted to understand the individual scenarios. Besides that, a comparison was done between a clean Windows Vista and a partner IT image to understand system boot and shutdown time, idle CPU utilization, and disk read count.
The principles behind designing for efficiency are:
  • Choosing the right model
  • Leveraging the Latest Windows infrastructure
  • Making performance optimizations
  • Eliminating unnecessary privileges
  • Evaluating and measuring
  • Iterating
For Windows 7, there will be an update to the Service Control Manager (SCM). Currently, Auto Start Windows Service type enables a service to launch at boot and never terminates, usually waiting for rare events. Windows 7 introduces a new type of service, the Trigger-Start Service which centralizes environmental detection logic. Some examples of Trigger-Start Service in Windows 7:
  • AELookupSvc: Processes application compatibility cache
  • BTHSERV: Discovery and association of Bluetooth devices
  • BDESERV: Provides Bit Locker functionally for user-inserted removable media (e.g. USB hard disk)
This session also presented recommendations for performing service shutdowns and service control handlers. For service security, it is highly recommended to run services in the least required privilege and avoid LocalSystem privileges. Also, since Windows Vista, the Windows platform introduced the concept of using service-specific Security IDs (SIDs) to ensure more secure recognition and authentication of services.
Besides services, Windows 7 introduces enhancements to scheduled tasks, triggers, and conditions in the areas of calendar, boot, logon, idle, event log, workstation lock, and workstation unlock.
For power and efficiency, it is recommended that idle background activities do not consume more than 2 percent of CPU utilization. The session also introduced the Windows Performance Toolkit (XPerf) to measure the footprint of the background processes and activities.

List of demos

Converting a Service to a Trigger-Start Service / This demonstration looked at the source code that converts an existing Windows Service to a Windows 7 Trigger-Start Service. The demonstration also walked through the possible scenarios that can trigger a Windows 7 service, for example the insertion of a USB device. / About 12 min into the presentation.

Conclusion

Windows 7 introduces new paradigms and concepts in the areas of background processes and activities. To the developer, it is key to understand the changes for Windows 7 in order to design more efficient Windows Services and Scheduled Tasks. For example, it is recommended to use the Trigger-Start service type instead of the Auto Start service type.