osGetTaskQuantum function
Declaration:
BOOL osGetTaskQuantum(
  HANDLE Handle,
  UINT8 *Quantum
);
Parameters:
Handle

A handle to the task whose time quantum is to be retrieved.

Quantum

A pointer to a variable that will receive the maximum number of time quanta assigned to the task.

Return value:

Returns TRUE on success or FALSE on failure. Use the osGetLastError function to obtain extended error information.

Description:

This function retrieves the maximum number of time quanta assigned to the specified task.

When two or more ready tasks share the same priority level, the scheduler ensures their concurrent execution by rapidly switching between them. The scheduler assigns a short CPU time slice, known as a time quantum, to each running task. For tasks performing long-running operations, you may configure the scheduler to allocate multiple CPU time slices. By default, the scheduler assigns a single quantum. The number of assigned time quanta can be modified using the osSetTaskQuantum function, and retrieved using this function.

This function is available only when the OS_TASK_QUANTUM_FUNC constant is set to 1. If this functionality is not required, it can be disabled to reduce the size of the output code.

Version:1.0
Header file:OS_Task.h (include OS_API.h)
See also: BOOL, FALSE, HANDLE, OS_TASK_QUANTUM_FUNC, osGetLastError, scheduler, tasks, TRUE, using priority and time quanta
SpaceShadow documentation