Processing scenario

These 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. In process mode, when a connection logs in to Adaptive Server, it is assigned to a task that manages its network I/O.

    The task assigns the connection to an engine or engine group 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.

    In process mode, another task checks for incoming client requests once every clock tick.

    In threaded mode, Adaptive Server wakes a dedicated thread as soon as a new request arrives.

    When this second task finds a command (or query) from the connection, it wakes up the first 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 query processor 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.

    In threaded mode, because there is no network affinity, tasks return results from any engine.

    In process mode, if a task is executing on its network engine, the results are returned. If the task is executing on an engine other than its network engine, the executing engine adds the task to the network engine’s high-priority queue.