Processing scenario

The following steps describe how a task is scheduled in the SMP environment. The execution cycle for single-processor systems is very similar. A single-processor system handles task switching, putting tasks to sleep while they wait for disk or network I/O, and checking queues in the same way.

  1. Assigning a network engine during login

    When a connection logs in to Adaptive Server, it is assigned to an engine that will manage its network I/O. This engine then handles the login. The engine assigns a task structure and establishes packet size, language, character set, and other login settings. A task sleeps while waiting for the client to send a request.

  2. Checking for client requests

    Another engine checks for incoming client requests once every clock tick.

    When this engine finds a command (or query) from the connection for a task, it wakes up the task and places it on the end of its run queue.

  3. Fulfilling a client request

    When a task becomes first in the queue, the engine parses, compiles, and begins executing the steps defined in the task’s query plan

  4. Performing disk I/O

    If the task needs to access a page locked by another user, it is put to sleep until the page is available. After such a wait, the task’s priority is increased, and it is placed in the global run queue so that any engine can run it

  5. Performing network I/O

    When the task needs to return results to the user, the engine on which it is executing issues the network I/O request, and puts the tasks to sleep on a network write.

    The engine checks once each clock tick to determine whether the network I/O has completed. When the I/O has completed, the task is placed on the run queue for the engine to which it is affiliated, or the global run queue.