GoingDeep: Service Controller and Background Processing

GoingDeep

At any given point, Windows is executing a lot of code. Some of this code runs in the background as services. In pre Windows 7 operating systems some services were set to auto run even though the configuration of the system (installed apps, hardware, etc) did not warrant them running. This had a ...

Running time
0h42m
File size
20.00MB

Download Original File | View original post

Episode synopsis

At any given point, Windows is executing a lot of code. Some of this code runs in the background as services. In pre Windows 7 operating systems some services were set to auto run even though the configuration of the system (installed apps, hardware, etc) did not warrant them running. This had a four-fold potential effect:

1) Windows might start up slower as the service fires up
2) Users may experience sluggish performance as the service runs taking up processing and memory resources
3) Windows might take a long time to shut down as the service shuts down, unwinding itself and cleaning up it's resources
4) The surface area for code-level security breaches is larger(though, since Vista, most services run in a restricted security context)

Chittur Subbaraman, Windows kernel developer extraordinaire, and team spent a great deal of time thinking about and rectifying these problems by re-architecting the Windows 7 Service Controller. They also identified services that don't need to auto run (like a TabletPC Pen service that need not ever run on a desktop (non-Tablet) machine by default). But they went much further than simply figuring out which services can be set to manual start-up state in Windows 7. They added a new feature for service developers based on the trigger pattern: services can be started and shut down via triggers - this means developers are able to specify programmatically when a service needs to start or stop. This allows Wndows to control services in a much more dynamic way so less code has to run in any given user session. The Service Controller monitors and reacts to trigger events as opposed to just running services marked as auto when the system starts. Less code running in the background on Windows means more resources available for foregrond processing, faster start up of sessions and faster shut down.

The great work in the Windows 7 service controller by Chittur and team has a direct impact on the performance of Windows 7. Tune in to learn about the details and history of the service controller (and Task Manager).

Here are some great resources for you to read to get the details behind all of this great engineering in the background processing mechanisms deep inside Windows 7. 

·White paper on Designing Efficient Background Processes.

·PDC talk on Designing Efficient Background Processes.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray