HELPLIB.HLB  —  DCE  DCE_THREADS, Application Routines, pthread_attr_setinheritsched
 NAME

    pthread_attr_setinheritsched - Changes the inherit scheduling
 				  attribute

 SYNOPSIS

     #include <pthread.h>

     int pthread_attr_setinheritsched( pthread_attr_t attr,
                                        int inherit );

 PARAMETERS

     attr             Thread attributes object to be modified.

     inherit          New value for the inherit scheduling attribute.
                      Valid values are as follows:

                      PTHREAD_INHERIT_SCHED
                              This is the default value. The created
                              thread inherits the current priority
                              and scheduling policy of the thread
                              calling pthread_create().

                       PTHREAD_DEFAULT_SCHED
                              The created thread starts execution with
                              the priority and scheduling policy stored
                              in the thread attributes object.

 DESCRIPTION

 The pthread_attr_setinheritsched() routine changes the inherit schedul-
 -ing attribute of thread creation.  The inherit scheduling attribute spe
 cifies whether threads created using the specified thread attributes obj
 ect inherit the scheduling attributes of the creating thread, or use the
 scheduling attributes stored in the thread attributes object that is
 passed to pthread_create().

 The first thread in an application that is not created by an explicit
 call to pthread_create() has a scheduling policy of SCHED_OTHER.  (See
 the pthread_attr_setprio() and pthread_attr_setsched() routines for more
 information on valid priority values and valid scheduling policy values,
 respectively.)

 Inheriting scheduling attributes (instead of using the scheduling attri-
 butes stored in the attributes object) is useful when a thread is creat-
 ing several helper threads-threads that are intended to work closely
 with the creating thread to cooperatively solve the same problem. For
 example, inherited scheduling attributes ensure that helper threads
 created in a sort routine execute with the same priority as the calling
 thread.

 RETURN VALUES

 If the function fails, -1 is returned, and errno may be set to one of
 the following values:

    Return   Error      Description
    ___________________________________________________________
    0                   Successful completion.

    -1       [EINVAL]   The value specified by attr is invalid.

    -1       [EINVAL]   The value specified by inherit is invalid.

 RELATED INFORMATION

      FUNCTIONS:  pthread_attr_create
                  pthread_attr_getinheritsched
                  pthread_attr_setprio
                  pthread_attr_setsched
                  pthread_create
Close Help