thread_set_smt_priority or thread_read_smt_priority System Call
Purpose
Sets or reads the current simultaneous multithreading (SMT) thread priority for a user-thread.
Syntax
#include <sys/errno.h>
#include <sys/thread.h>
#include <sys/processor.h>
smt_thread_priority_t Priority;
#include <sys/errno.h>
#include <sys/thread.h>
#include <sys/processor.h>
Description
The SMT thread priority that is associated with a logical CPU, SMT hardware thread, controls the relative priority of the logical CPU in relation to the other logical CPUs on the same processor core. The relative priority between the SMT hardware threads on a processor core determines how decode cycles are granted to each SMT hardware thread. The SMT thread priority can be used to cause a particular application thread to be favored over other application threads that are running on the other SMT hardware threads in the same processor core. It is done by increasing the SMT thread priority of the logical CPU the application is running on, or by lowering the SMT thread priority of the application threads that are running on the other logical CPUs associated with the same processor core.
These interfaces are not supported on some processor architectures.
If the process-thread is dispatched to a logical CPU that is running in non-SMT mode, the SMT thread priority level has no effect.
- LOW
- MEDIUM LOW
- NORMAL
- VERY LOW
- LOW
- MEDIUM LOW
- NORMAL
- MEDIUM HIGH
- HIGH
The thread_read_smt_priority system call returns the current SMT priority level that is registered by the process thread. If the process thread did not register a required SMT priority level, then the default priority level of NORMAL is returned.
Parameters
Item | Description |
---|---|
Priority | Used to specify one of the following parameters:
|
Execution Environment
The thread_read_smt_priority and thread_set_smt_priority system calls can be called from the process environment only.
Return Values
On successful completion, the thread_set_smt_priority system call returns 0. Otherwise, -1 is returned and the errno global variable is set to indicate the error.
On successful completion, the thread_read_smt_priority system call returns the current required SMT priority. Otherwise, -1 is returned and the errno global variable is set to indicate the error.
Error Codes
Item | Description |
---|---|
EPERM | The process attempted to set the SMT thread priority level to a value other than T_LOW_SMT_PRI, T_MEDIUMLOW_SMT_PRI, or T_NORMAL_SMT_PRI and does not have the necessary privileges. |
EINVAL | The required priority value that is specified is invalid. |
ENOSYS | SMT thread priority level manipulation is not supported on this system. |