Scheduling tasks to the engine

Figure 3-4 shows internally processing for tasks (or worker processes) queued for an Adaptive Server engine in a single-CPU environment. Adaptive Server, not the operating system, dynamically schedules client tasks from the run queue onto the engine. When the engine finishes processing one task, it executes the task at the beginning of the run queue.

When a task begins running, the engine continues processing it until one of the following events occurs:

When you execute sp_who on a single-CPU system with multiple active tasks, sp_who output shows only a single task as “running”—it is the sp_who task itself. All other tasks in the run queue have the status “runnable.” The sp_who output also shows the cause for any sleeping tasks.

Figure 3-4 also shows the sleep queue with two sleeping tasks, as well as other objects in shared memory. Tasks are put to sleep while they wait for resources or for the results of a disk I/O operation.

Figure 3-4: Tasks queue up for the Adaptive Server engine

Image shows tasks queueing for Adaptive Server. There is a run queue and a sleep queue, all in Adaptive Server’s shared memory, which also includes the data-, procedure-, and index cache.