Preemptive vs. Cooperative Tasking

An important difference—in fact, probably the most important difference—between Windows' scheduler and SQL Server's UMS is that Windows' scheduler is a preemptive scheduler, while UMS implements a cooperative model. What does this mean? It means that Windows prevents a single thread from monopolizing a processor. As we discussed in Chapter 3, each thread gets a specified time slice in which to run, after which Windows automatically schedules it off the processor and allows another thread to run if one is ready to do so. UMS, by contrast, relies on threads to voluntarily yield. If a SQL Server worker thread does not voluntarily yield, it will likely prevent other threads from running.

You may be wondering why ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.