PTHREAD_GETSCHEDPARAM(3C) Standard C Library Functions NNAAMMEE pthread_getschedparam, pthread_setschedparam - access dynamic thread scheduling parameters SSYYNNOOPPSSIISS cc -mt [ _f_l_a_g... ] _f_i_l_e... -lpthread [ _l_i_b_r_a_r_y... ] #include iinntt pptthhrreeaadd__ggeettsscchheeddppaarraamm(pptthhrreeaadd__tt _t_h_r_e_a_d, iinntt **rreessttrriicctt _p_o_l_i_c_y, ssttrruucctt sscchheedd__ppaarraamm **rreessttrriicctt _p_a_r_a_m); iinntt pptthhrreeaadd__sseettsscchheeddppaarraamm(pptthhrreeaadd__tt _t_h_r_e_a_d, iinntt _p_o_l_i_c_y, ccoonnsstt ssttrruucctt sscchheedd__ppaarraamm **_p_a_r_a_m); DDEESSCCRRIIPPTTIIOONN The pptthhrreeaadd__ggeettsscchheeddppaarraamm(()) and pptthhrreeaadd__sseettsscchheeddppaarraamm(()) functions allow the scheduling policy and scheduling parameters of individual threads within a multithreaded process to be retrieved and set. Supported policies are : SSCCHHEEDD__OOTTHHEERR traditional time-sharing scheduling class SSCCHHEEDD__FFIIFFOO real-time class: run to completion SSCCHHEEDD__RRRR real-time class: round-robin SSCCHHEEDD__IIAA interactive time-sharing class SSCCHHEEDD__FFSSSS fair-share scheduling class SSCCHHEEDD__FFXX fixed priority scheduling class See pptthhrreeaaddss(5). The affected scheduling parameter is the _s_c_h_e_d___p_r_i_o_r_i_t_y member of the sscchheedd__ppaarraamm structure. The pptthhrreeaadd__ggeettsscchheeddppaarraamm(()) function retrieves the scheduling policy and scheduling parameters for the thread whose thread IIDD is given by _t_h_r_e_a_d and stores those values in _p_o_l_i_c_y and _p_a_r_a_m, respectively. The priority value returned from pptthhrreeaadd__ggeettsscchheeddppaarraamm(()) is the value specified by the most recent pptthhrreeaadd__sseettsscchheeddppaarraamm(()) or pptthhrreeaadd__ccrreeaattee(()) call affecting the target thread, and does not reflect any temporary adjustments to its priority as a result of any priority inheritance or ceiling functions. The pptthhrreeaadd__sseettsscchheeddppaarraamm(()) function sets the scheduling policy and associated scheduling parameters for the thread whose thread IIDD is given by _t_h_r_e_a_d to the policy and associated parameters provided in _p_o_l_i_c_y and _p_a_r_a_m, respectively. If the pptthhrreeaadd__sseettsscchheeddppaarraamm(()) function fails, no scheduling parameters will be changed for the target thread. RREETTUURRNN VVAALLUUEESS If successful, the pptthhrreeaadd__ggeettsscchheeddppaarraamm(()) and pptthhrreeaadd__sseettsscchheeddppaarraamm(()) functions return 00. Otherwise, an error number is returned to indicate the error. EERRRROORRSS The pptthhrreeaadd__ggeettsscchheeddppaarraamm(()) and pptthhrreeaadd__sseettsscchheeddppaarraamm(()) functions will fail if: EESSRRCCHH The value specified by _t_h_r_e_a_d does not refer to an existing thread. The pptthhrreeaadd__sseettsscchheeddppaarraamm(()) function will fail if: EEIINNVVAALL The value specified by _p_o_l_i_c_y or one of the scheduling parameters associated with the scheduling policy _p_o_l_i_c_y is invalid. EEPPEERRMM The caller does not have the appropriate permission to set either the scheduling parameters or the scheduling policy of the specified thread. AATTTTRRIIBBUUTTEESS See aattttrriibbuutteess(5) for descriptions of the following attributes: +--------------------+-------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-------------------+ |Interface Stability | Committed | +--------------------+-------------------+ |MT-Level | MT-Safe | +--------------------+-------------------+ |Standard | See ssttaannddaarrddss(5). | +--------------------+-------------------+ SSEEEE AALLSSOO pptthhrreeaadd__aattttrr__iinniitt(3C), sscchheedd__ggeettppaarraamm(3C), sscchheedd__ggeett__pprriioorriittyy__mmaaxx(3C), sscchheedd__ggeett__pprriioorriittyy__mmaaxx(3C), sscchheedd__ggeett__pprriioorriittyy__mmiinn(3C), sscchheedd__sseettppaarraamm(3C), sscchheedd__ggeettsscchheedduulleerr(3C), sscchheedd__sseettsscchheedduulleerr(3C), aattttrriibbuutteess(5), pptthhrreeaaddss(5), ssttaannddaarrddss(5) April 1, 2008 PTHREAD_GETSCHEDPARAM(3C)