Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Initiation/deinitiation of tasks

&pagelevel(5)&pagelevel

The initiation and deinitiation of tasks comprises the following specific functions:

  • Initiation

    Allocation of the resource CPU to an active, executable task (which is in the "active, ready" state).

  • Deinitiation

    Withdrawal of the resource CPU when delays are expected (transition to the “active, not ready” state).

  • Preemption

    Deinitiation of a task followed by initiation of another task with a higher priority.

  • Micro Time Slice

    Micro Time Slice (MTS)

Initiation

From the available active ready tasks, the dispatcher routine of the task initiator selects and passes control to the task with the highest initiation priority (--> task in control).

With multiprocessors there are CPU-local queues (see also section "Controlling tasks viaqueues").These queues are populated cyclically when tasks are activated. For each CPU, the task with the highest initiation priority is selected from the queue assigned to that CPU. Higher priorities which may be assigned to tasks in queues which belong to other CPUs are of no significance. The strategy “foreign tasks take precedence over idle states” is also adopted, i.e. a task from a “foreign” queue is initiated before the CPU becomes idle as a result of underloading. In this case, those queues containing the most tasks (“longest Q1”) are accessed.

If the TANGRAM function is used, the local CPU queues are populated according to the TANGRAM assignment algorithms rather than cyclically (see section "TANGRAM concept"). In these circumstances, the “idle in preference to foreign” strategy is adopted.

Initiation priority

Calculation of the initiation priority is analogous to that of the activation priority. The following additional points are taken into account:

  • the point in time tA of the most recent system service slice runout.
    The difference: current point in time minus tA is formed.

  • the “task in control” is given preference when calculating priorities.
    The formula P = P + 5 is used in order to keep the preemption rate as low as possible.

Deinitiation

In the interest of efficient CPU utilization, the system will withdraw control from a task (even if this task has top priority) whenever there are immediately foreseeable wait periods:

  • For short wait periods there is a transition to the “active, not ready” state. This applies to wait periods such as: performing an I/O operation (DMS I/O, paging I/O), waiting for bourse or ITC events, VPASS 0 wait call in program.

  • For long wait periods deactivation will also occur.
    This applies to wait periods such as: terminal input in interactive mode, PASS wait call, VPASS wait call in program.

Preemption

At the initiation level, preemption is entirely dependent on the initiation priority.

In order to preempt the “task in control”, the priority of the task to be newly initialized must be:

  • higher by at least the value 5

  • higher by the value 10 if the task in control is in CPU state TPR.

After an SVC call which has not led to deinitiation of the task, no preemption takes place. Only when another task moves to the head of the CPU queue while this SVC is being processed, and when the above-mentioned conditions are fulfilled, does the task calling the SVC lose the CPU.

Micro Time Slice

The “micro time slice” (MTS) is the maximum amount of CPU time which a task can occupy without interruption.

The CPU time used in the TU and TPR CPU states is added together to determine the CPU intensity of the individual task. In the case of a “micro time slice runout”, the priority is checked or redefined. When multiprocessors are used, following a “micro time slice runout” the task with the highest priority is selected from all the queues (Q1).

The size of the MTS varies between two outer limits, and is dependent on CPU intensity. After each I/O operation involving a wait period, the MTS is redefined:

MTS = Current CPU time - CPU time of the penultimate I/O

The limits are dependent on the CPU speed; the faster the CPU, the lower the limit values.

The more I/O-intensive the characteristics of a task, the smaller its associated MTS (which, however, must not fall beneath a certain minimum value). Since I/O-intensive tasks have low CPU intensity, no “micro time slice runout“ occurs.

If the task characteristics change in the direction of greater CPU intensity, a “micro time slice runout“ occurs relatively quickly, followed by a calculation of priority. This ensures that the system can respond quickly to changes in workload characteristics from I/O-intensive to CPU-intensive (as it does not have to wait for the periodic priority check). This type of workload change is particularly critical, since the domination of CPU-intensive tasks has a corresponding adverse effect on the degree of simultaneous processing, thereby reducing throughput.