Time slice

Adaptive Server handles several processes concurrently by switching between them, allowing one process to run for a fixed period of time (a time slice) before it lets the next process run.

As shown in Table 4-1, the time slice attribute is different for each predefined execution class. EC1 has the longest time slice value, EC3 has the shortest time slice value, and EC2 has a time slice value that is between the values for EC1 and EC3.

More precisely, the time period that each task is allowed to run is based on the value for the time slice configuration parameter, as described in “Scheduling client task processing time”. Using default values for configuration parameters, EC1 execution objects may run for double the time slice value; the time slice of an EC2 execution object is equivalent to the configured value; and an EC3 execution object yields at the first yield point it encounters, often not running for an entire time slice.

If tasks do not yield the engine for other reasons (such as needing to perform I/O or being blocked by a lock) the effect is that EC1 clients run longer and yield the engine fewer times over the life of a given task. EC3 execution objects run for very short periods of time when they have access to the engine, so they yield much more often over the life of the task. EC2 tasks fall between EC1 and EC3 in runtime and yields.

Currently, you cannot assign time slice values when you create user-defined execution classes with sp_addexeclass. Adaptive Server assigns the EC1, EC2, and EC3 time slice values for high, medium, and low priority tasks, respectively.