home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / sched_setscheduler.z / sched_setscheduler
Encoding:
Text File  |  2001-04-17  |  9.3 KB  |  198 lines

  1.  
  2.  
  3.  
  4. sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))                                    sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr - set the scheduling policy of a process
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<sssscccchhhheeeedddd....hhhh>>>>
  13.      _iiii_nnnn_tttt _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr _((((_pppp_iiii_dddd______tttt _p_i_d_,,,, _iiii_nnnn_tttt _p_o_l_i_c_y_,,,,
  14.      _cccc_oooo_nnnn_ssss_tttt _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_cccc_hhhh_eeee_dddd______pppp_aaaa_rrrr_aaaa_mmmm _****_p_a_r_a_m_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      The _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr system call is used to set the scheduling policy
  18.      and related parameters for the process specified by _p_i_d.  If _p_i_d is set
  19.      to zero, then the scheduling policy and parameters of the calling process
  20.      will be affected.
  21.  
  22.      The _p_o_l_i_c_y parameter is used to select one of the following scheduling
  23.      policies:
  24.  
  25.      SSSSCCCCHHHHEEEEDDDD____FFFFIIIIFFFFOOOO
  26.              The first-in-first-out policy schedules processes according to
  27.              their assigned priority values. The highest priority process is
  28.              guaranteed control of the processor until it willingly yields the
  29.              processor or blocks on a contended resource. If there is more
  30.              than one runnable highest priority process, the highest priority
  31.              process waiting the longest is granted control of the processor.
  32.              A running process is preempted when a higher priority process
  33.              becomes runnable.
  34.  
  35.      SSSSCCCCHHHHEEEEDDDD____RRRRRRRR
  36.              The round-robin scheduling policy schedules processes according
  37.              to their assigned priority values. The highest priority process
  38.              is guaranteed control of the processor until it: willingly yields
  39.              the processor, blocks on a contended resource, or exceeds its
  40.              time quantum. If there is more than one runnable highest priority
  41.              process, the highest priority process waiting the longest is
  42.              granted control of the processor. When a process exceeds its time
  43.              quantum it yields the processor and awaits rescheduling.  A
  44.              running process is preempted when a higher priority process
  45.              becomes runnable.
  46.  
  47.      Note that _S_C_H_E_D__F_I_F_O and _S_C_H_E_D__R_R processes are of higher priority than
  48.      all other processes in the system.  Because of this, such a process may
  49.      ddddeeeeaaaaddddlllloooocccckkkk the system if it enters an infinite loop.  Further note, that
  50.      the scheduling policy and priority are inherited across a fork and that
  51.      the scheduling policy is shared by all members of a share group (see
  52.      sproc(2)).
  53.  
  54.      SSSSCCCCHHHHEEEEDDDD____TTTTSSSS
  55.              The _S_C_H_E_D__T_S scheduling policy is a basic timeshare scheduling
  56.              policy.  All _S_C_H_E_D__T_S processes acquire CPU resources in
  57.              proportion to their priority or nice value.  Processes aquire the
  58.              processor for a time quantum, the length of which is returned via
  59.              the _s_c_h_e_d__r_r__g_e_t__i_n_t_e_r_v_a_l(_2) system call.
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))                                    sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))
  70.  
  71.  
  72.  
  73.      SSSSCCCCHHHHEEEEDDDD____OOOOTTTTHHHHEEEERRRR
  74.              The _S_C_H_E_D__O_T_H_E_R scheduling policy is equivalent to the SCHED_TS
  75.              policy and allows a program to indicate that it no longer needs a
  76.              real-time scheduling policy in a portable manner.
  77.  
  78.      The parameters of the selected _p_o_l_i_c_y are specified by the parameter
  79.      structure at address _p_a_r_a_m.
  80.  
  81.      The priority of the target process may be modified by setting the desired
  82.      priority value in the sched_priority field of the _p_a_r_a_m structure.
  83.  
  84.      Unlike IRIX 6.2 and previous releases, processes having a higher
  85.      numerical priority value are more important than processes having a lower
  86.      numerical priority value.  Specified priorities remain fixed, unless
  87.      explicitly changed in the future, and are not affected by priority aging
  88.      schemes.
  89.  
  90.      The priority range for these scheduling policies may be obtained via the
  91.      _ssss_cccc_hhhh_eeee_dddd______gggg_eeee_tttt______pppp_rrrr_iiii_oooo_rrrr_iiii_tttt_yyyy______mmmm_iiii_nnnn(2) and _ssss_cccc_hhhh_eeee_dddd______gggg_eeee_tttt______pppp_rrrr_iiii_oooo_rrrr_iiii_tttt_yyyy______mmmm_aaaa_xxxx(2) function calls.
  92.      However, arbitrary priority values should not be used.  Developers must
  93.      consider the needs of the application and how it should interact with the
  94.      rest of the system, before selecting a real-time priority.  For more
  95.      information, see the "Real-Time Priority Band" section of _rrrr_eeee_aaaa_llll_tttt_iiii_mmmm_eeee(5).
  96.  
  97.      Runnable processes scheduled with real-time policies are always granted
  98.      processor control ahead of timeshare processes, regardless of priority.
  99.  
  100.      The calling process must have the CCCCAAAAPPPP____SSSSCCCCHHHHEEEEDDDD____MMMMGGGGTTTT capability [see
  101.      _c_a_p_a_b_i_l_i_t_y] to successfully execute _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr.
  102.  
  103.      If the process specified by _p_i_d is currently executing or is in a
  104.      runnable state, _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr causes the process to be rescheduled
  105.      in accordance with its priority.
  106.  
  107.      _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr will fail if one or more of the following are true:
  108.  
  109.      [EINVAL]       The _p_o_l_i_c_y argument does not represent a valid posix
  110.                     scheduling policy.
  111.  
  112.      [EINVAL]       One of the specified parameters at address _p_a_r_a_m are out
  113.                     of range or scope.
  114.  
  115.      [EPERM]        The calling process does not have the CCCCAAAAPPPP____SSSSCCCCHHHHEEEEDDDD____MMMMGGGGTTTT
  116.                     capability.
  117.  
  118.      [ESRCH]        The process specified by _p_i_d does not exist.
  119.  
  120. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  121.      capability(4), realtime(5), sched_getparam(2), sched_setparam(2),
  122.      sched_getscheduler(2), sched_yield(2), sched_get_priority_max(2),
  123.      sched_get_priority_min(2), sched_rr_get_interval(2), pthreads(5)
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))                                    sssscccchhhheeeedddd____sssseeeettttsssscccchhhheeeedddduuuulllleeeerrrr((((2222))))
  136.  
  137.  
  138.  
  139. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  140.      Upon successful completion, _ssss_cccc_hhhh_eeee_dddd______ssss_eeee_tttt_ssss_cccc_hhhh_eeee_dddd_uuuu_llll_eeee_rrrr returns the previous
  141.      scheduling policy value of the process _p_i_d.
  142.  
  143.      Upon failure, a value of -1 is returned to the calling process and _eeee_rrrr_rrrr_nnnn_oooo
  144.      is set to indicate the error.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                                                         PPPPaaaaggggeeee 3333
  195.  
  196.  
  197.  
  198.