Database Reference
In-Depth Information
Spinlock is an internal lightweight synchronization mechanism that protects access to data structures.
Coverage of spinlock is beyond the scope of this topic. You can obtain more information about the troubleshooting of
spinlock contention-related issues at: http://www.microsoft.com/en-us/download/details.aspx?id=26666 .
Note
Each scheduler has at most one task in running state. In addition, it has two different queues—one for runnable
tasks and one for suspended tasks. When the running task needs some resources—a data page from a disk, for
example—it submits an I/O request and changes the state to suspended . It stays in the suspended queue until the request
is fulfilled and the page is read. After that, the task is moved to the runnable queue when it is ready to resume execution.
a grocery store is, perhaps, the closest real-life analogy to the SQl Server execution model. think of cashiers
as representing schedulers and customers in checkout lines are similar to tasks in the runnable queue. a customer who
is currently checking out is similar to a task in the running state.
Note
if item is missing a upC code, a cashier sends a store worker to do a price check. the cashier suspends the checkout
process for the current customer, asking her or him to step aside (to the suspended queue). When the worker comes
back with the price information, the customer who had stepped aside moves to the end of the checkout line (end of the
runnable queue).
it is worth mentioning that the SQl Server process is much more efficient as compared to real-life, when others wait
patiently in-line during a price check. however, a customer who is forced to move to the end of the runnable queue would
probably disagree with such a conclusion.
Figure 27-2 illustrates the typical task life cycle of the SQL Server Execution Model. The total task execution time
can be calculated as a summary of the time task spent in the running state (when it ran on the scheduler), runnable state
(when it waited for an available scheduler), and in suspended state (when it waited for a resource or external event).
Figure 27-2. Task life cycle
 
 
Search WWH ::




Custom Search