Microsoft SQL Server 2012 Bible
by Adam Jorgensen, Jorge Segarra, Patrick LeBlanc, Jose Chinchilla, Aaron Nelson
The SQL Server OS
To execute tasks, SQL Server uses its own custom operating system, referred to as the SQLOS, which serves as a thin layer between SQL Server and the Windows Operating System. SQLOS provides memory management, task scheduling, and IO completion, along with a number of functions for SQL Server.
The SQLOS is a nonpreemptive, or cooperative, operating system. This means that worker threads self-regulate the amount of time they use the scheduler. A worker can remove itself from the scheduler if its time slice is up. SQL Server operates this way because it has a better understanding as to how to most efficiently handle and schedule its work than the general Windows OS does.
To contrast, Windows is a preemptive operating system. This means that processes are taken on and off of the CPU at the decision of the OS (typically in a round-robin fashion).
As tasks run inside the database engine, they typically follow a circular pattern that jumps in and out of three main states:
- Runnable: Workers in a runnable status are waiting for time to execute on the scheduler. These can be workers that have previously been suspended, or workers executing new requests waiting to be executed. Time spent in the runnable queue is pure CPU wait time. This is also known as signal wait time because the tasks are waiting for their “signal” to run. Workers in the runnable queue eventually get to the scheduler so that they can execute.
- Running: Workers with a running status are currently executing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access