4.9.   159

 pthread_attr_setschedparam()    
  (  attr),    -
.  param   ,    -
.  sched_param       :

struct sched_param {

int sched priority;

//. . .
};

,       ,    ,
        -
 ,    .     
    SCHED_FIFO,   SCHED_RR, 
  sched_param     sched_priority.

      , 
 sched_get_priority_min ()  sched_get_priority_max ().



^include <sched.h>

int sched_get_priority_max(int policy) ;

int sched_get_priority_niin(int policy) ;

     policy  , -
   ,     
,       
(  )    .

         -
 ,    4.4.

//  4.4.    
//                  
//               

//. . .
^define Min_Stack_Req 3000000

pthread_t ThreadA;

pthread_attr_t SchedAttr;

size_t DefaultSize,SizeO??set,NewSize;

int MinPriority,MaxPriority,MidPriority;

sched_param SchedParam;

int main(int argc, char *argv[])

{

//. . .

//   .

pthread_attr_init(&SchedAttr) ;

//     
//    .
MinPriority = sched_get_priority_max(SCHED_RR) ;

MaxPriority = sched_get_priority_min(SCHED_RR);