160  4.  ++-                  

II   .
MidPriority = (MaxPriority + MinPriority)/2 ;

//      sched_parain.
SchedParam.sched_priority = MidPriority;

//   .
pthread_attr_setschedparam(&Attrl,&SchedParam) ;

//-   
/ /    .
pthread_attr_setinheritsched(&Attrl,

PTHREAD_EXPLICIT_SCHED) ;

//   .
pthread_attr_setschedpolicy(&Attrl,SCHED_RR) ;

//      .
pthread_create(&ThreadA,&Attrl,fcask2,Value) ;

}

  4.4      ThreadA 
    SchedAttr.   .

1.   .

2.        
.

3.   .

4.      sched_param.

5.   .

6.        .

7.   .

8.      .

      
      .   -
                  

pthread_setschedparam()  pthread_setschedprio().



#include <pthread.h>

int pthread_setschedparam(

pthread__t thread, int policy,

const struct sched_param *param) ;

int pthread_getschedparam(

pthread__t thread,

int *restrict policy,

struct sched_param *restrict param) ;

int pthread_setschedprio(pthread_t thread, int prio);