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, the connection assigned to an engine that will manage its network I/O. This engine then manages 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.

    How a task returns results to the user depends on whether the task is executing on its network engine. If it 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.