f_pthread_setschedparam(thread, policy, param)

Purpose

This function can be used to dynamically set the scheduling policy and the scheduling property of a thread. The target thread is identified by argument thread. The new scheduling policy for the target thread is provided through argument policy. The new scheduling property of the target thread will be set to the value provided by argument param. The sched_priority field in param defines the scheduling priority. Its range is 1-127.

Class

Function

Argument Type and Attributes

thread
TYPE(f_pthread_t), INTENT(INOUT)

policy
INTEGER(4), INTENT(IN)

param
TYPE(f_sched_param), INTENT(IN)

Result Type and Attributes

INTEGER(4)

Result Value

On successful completion, this function returns 0. Otherwise, this function returns one of the following errors

ENOSYS
The POSIX priority scheduling option is not implemented on Linux.

ENOTSUP
The value of argument policy or param is not supported.

EPERM
The target thread is not permitted to perform the operation or is in a mutex protocol already.

ESRCH
The target thread does not exist or is invalid.
IBM Copyright 2003